From 839ee57e23b3be843d4c5ea5bb7d5024c5ae1b04 Mon Sep 17 00:00:00 2001 From: Freshair129 <94353529+Freshair129@users.noreply.github.com> Date: Sun, 27 Sep 2026 11:05:49 +0700 Subject: [PATCH] feat: replayable C0.4 golden corpus (registry v2) The v1 registry pinned a request hash and an expected-result hash for each case but shipped neither the request nor the result, so nothing could recompute them (GKS-MIG-002). Registry c0-qualification/v2 ships both for every runnable case: - request fixtures (cases/.json); - golden transcripts (expected/.json); - a runner that replays each case against a real gks-server stdio process on a fresh store. A replay passes only when all of these hold: - the fixture still hashes to the registry; - every step's intent annotation holds; - stdout carries JSON-RPC frames only; - no fixture credential reaches output or the store; - the normalized transcript hashes to the registry. Server-clock instants, measured durations and clock-derived hashes are replaced by stable labels before hashing. Equal hashes keep equal labels, so idempotent replays stay visible. --write records a case only when two runs agree. Scope and gating: - The 17 tool cases each call their own tool. Eight scenario cases cover API-010 replay, the tenant wall, auth denial, transport denial, GenesisRAG17 receipts, backend failure and lost-response replay. - The Tier-4 physical readback is split out as its own NOT_RUN case. - Manifest: PASS 24, NOT_RUN 1. - check:c0 verifies fixture and transcript hashes statically and allows a PASS only for a replayable case. - The c0-gate CI slice now also runs check:corpus. The baseline is re-locked for the workflow change. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/test.yml | 2 +- docs/ADR-GKS-C0-QUALIFICATION.md | 20 +- docs/reports/2026-09-27-c0-corpus-v2.md | 179 + docs/reports/2026-09-27-p1-c0-closure.md | 7 +- package.json | 1 + scripts/c0-corpus/build-cases.mjs | 486 +++ scripts/c0-corpus/runner.mjs | 375 ++ scripts/check-c0-qualification.mjs | 21 +- scripts/run-c0-corpus.mjs | 119 + tests/contract/c0-golden-registry.test.mjs | 104 +- tests/fixtures/baseline-lock.json | 4 +- .../cases/C0.4-API010-REPLAY.json | 210 + .../cases/C0.4-AUTH-DENIAL.json | 441 +++ .../cases/C0.4-BACKEND-FAILURE.json | 156 + .../cases/C0.4-GENESISRAG17-RECEIPTS.json | 2115 +++++++++++ .../cases/C0.4-LOST-RESPONSE-REPLAY.json | 749 ++++ .../cases/C0.4-TENANT-WALL.json | 325 ++ .../c0-qualification/cases/C0.4-TOOL-001.json | 57 + .../c0-qualification/cases/C0.4-TOOL-002.json | 127 + .../c0-qualification/cases/C0.4-TOOL-003.json | 93 + .../c0-qualification/cases/C0.4-TOOL-004.json | 98 + .../c0-qualification/cases/C0.4-TOOL-005.json | 100 + .../c0-qualification/cases/C0.4-TOOL-006.json | 101 + .../c0-qualification/cases/C0.4-TOOL-007.json | 147 + .../c0-qualification/cases/C0.4-TOOL-008.json | 192 + .../c0-qualification/cases/C0.4-TOOL-009.json | 179 + .../c0-qualification/cases/C0.4-TOOL-010.json | 561 +++ .../c0-qualification/cases/C0.4-TOOL-011.json | 335 ++ .../c0-qualification/cases/C0.4-TOOL-012.json | 605 +++ .../c0-qualification/cases/C0.4-TOOL-013.json | 542 +++ .../c0-qualification/cases/C0.4-TOOL-014.json | 694 ++++ .../c0-qualification/cases/C0.4-TOOL-015.json | 743 ++++ .../c0-qualification/cases/C0.4-TOOL-016.json | 805 ++++ .../c0-qualification/cases/C0.4-TOOL-017.json | 845 +++++ .../cases/C0.4-TRANSPORT-DENIAL.json | 137 + .../expected/C0.4-API010-REPLAY.json | 136 + .../expected/C0.4-AUTH-DENIAL.json | 264 ++ .../expected/C0.4-BACKEND-FAILURE.json | 113 + .../expected/C0.4-GENESISRAG17-RECEIPTS.json | 3374 +++++++++++++++++ .../expected/C0.4-LOST-RESPONSE-REPLAY.json | 135 + .../expected/C0.4-TENANT-WALL.json | 284 ++ .../expected/C0.4-TOOL-001.json | 659 ++++ .../expected/C0.4-TOOL-002.json | 92 + .../expected/C0.4-TOOL-003.json | 92 + .../expected/C0.4-TOOL-004.json | 90 + .../expected/C0.4-TOOL-005.json | 85 + .../expected/C0.4-TOOL-006.json | 72 + .../expected/C0.4-TOOL-007.json | 122 + .../expected/C0.4-TOOL-008.json | 166 + .../expected/C0.4-TOOL-009.json | 238 ++ .../expected/C0.4-TOOL-010.json | 66 + .../expected/C0.4-TOOL-011.json | 749 ++++ .../expected/C0.4-TOOL-012.json | 1209 ++++++ .../expected/C0.4-TOOL-013.json | 1017 +++++ .../expected/C0.4-TOOL-014.json | 1010 +++++ .../expected/C0.4-TOOL-015.json | 1094 ++++++ .../expected/C0.4-TOOL-016.json | 1125 ++++++ .../expected/C0.4-TOOL-017.json | 1577 ++++++++ .../expected/C0.4-TRANSPORT-DENIAL.json | 117 + tests/fixtures/c0-qualification/registry.json | 1021 ++++- .../c0-qualification/result-manifest.json | 318 +- tests/integration/c0-corpus.test.mjs | 23 + 62 files changed, 26643 insertions(+), 280 deletions(-) create mode 100644 docs/reports/2026-09-27-c0-corpus-v2.md create mode 100644 scripts/c0-corpus/build-cases.mjs create mode 100644 scripts/c0-corpus/runner.mjs create mode 100644 scripts/run-c0-corpus.mjs create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-API010-REPLAY.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-AUTH-DENIAL.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-BACKEND-FAILURE.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-GENESISRAG17-RECEIPTS.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-LOST-RESPONSE-REPLAY.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TENANT-WALL.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-001.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-002.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-003.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-004.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-005.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-006.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-007.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-008.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-009.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-010.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-011.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-012.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-013.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-014.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-015.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-016.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TOOL-017.json create mode 100644 tests/fixtures/c0-qualification/cases/C0.4-TRANSPORT-DENIAL.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-API010-REPLAY.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-AUTH-DENIAL.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-BACKEND-FAILURE.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-GENESISRAG17-RECEIPTS.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-LOST-RESPONSE-REPLAY.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TENANT-WALL.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-001.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-002.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-003.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-004.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-005.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-006.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-007.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-008.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-009.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-010.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-011.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-012.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-013.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-014.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-015.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-016.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TOOL-017.json create mode 100644 tests/fixtures/c0-qualification/expected/C0.4-TRANSPORT-DENIAL.json create mode 100644 tests/integration/c0-corpus.test.mjs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13cadbc..17a5ad9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: security) npm run test:security ;; unit) npx vitest run tests/unit ;; client-pack) npm run pack:client ;; - c0-gate) npm run check:c0 && npm run check:baseline ;; + c0-gate) npm run check:c0 && npm run check:baseline && npm run check:corpus ;; *) echo "Unknown validation slice: ${{ matrix.slice }}" >&2; exit 1 ;; esac diff --git a/docs/ADR-GKS-C0-QUALIFICATION.md b/docs/ADR-GKS-C0-QUALIFICATION.md index 9ef3b24..23285de 100644 --- a/docs/ADR-GKS-C0-QUALIFICATION.md +++ b/docs/ADR-GKS-C0-QUALIFICATION.md @@ -1,7 +1,7 @@ --- -version: "0.2.1" +version: "0.3.0" created_at: "2026-09-22T00:00:00+07:00,RWANG,working-tree" -last_update: "2026-09-27T10:00:00+07:00,Claude" +last_update: "2026-09-27T12:00:00+07:00,Claude" status: "beta" approval_owner: "Boss (บอส)" approval_recorded_at: "2026-09-22T00:00:00+07:00" @@ -169,6 +169,21 @@ No production secrets, user data, or external live endpoint is allowed in the corpus. A qualification run must report `PASS`, `FAIL`, `NOT_RUN`, or `BLOCKED`; a missing external MSP fixture cannot become a green C0 claim. +**Registry v2 (2026-09-27, owner decision on GKS-MIG-002).** The hashes must +be reproducible, not only recorded. Registry `c0-qualification/v2` therefore +ships: + +- the request fixture for every runnable case, under `cases/`; +- its normalized golden transcript, under `expected/`; +- a runner (`npm run check:corpus`) that replays each case against a real + `gks-server` process on a fresh store. + +A status of `PASS` is only allowed for a case that has a replayable fixture. The +Tier-4 physical readback has no replayable fixture inside GKS, so it is its +own `NOT_RUN` case. Values the server derives from its clock are replaced by +stable labels before hashing; the rules are listed in +`docs/reports/2026-09-27-c0-corpus-v2.md`. + ## Contract and test matrix | Surface | Required assertion | Test class | @@ -217,3 +232,4 @@ review confirms: | 0.1.0 | 2026-09-22 | beta | User approved D1-D4 for C0 implementation | working-tree | RWANG | | 0.2.0 | 2026-09-22 | beta | Clarified compatibility versus secure MSP auth mode and recorded real-chain qualification boundary | working-tree | RWANG | | 0.2.1 | 2026-09-27 | beta | Cross-reference only: ADR-GKS-PIPELINE-VISIBILITY (accepted 2026-09-27) changes what `gks_search`, `gks_entity_get`, `gks_relations_get` and `gks_artifact_link` return for unpublished GenesisRAG17 entities. No request is newly rejected; see that ADR's observable-changes table. | working-tree | Claude | +| 0.3.0 | 2026-09-27 | beta | D4: registry v2. The owner decided to ship replayable request fixtures, golden transcripts and a corpus runner (GKS-MIG-002). A PASS now requires a replayable fixture. The Tier-4 physical readback is split out as its own NOT_RUN case. | working-tree | Claude | diff --git a/docs/reports/2026-09-27-c0-corpus-v2.md b/docs/reports/2026-09-27-c0-corpus-v2.md new file mode 100644 index 0000000..9e07315 --- /dev/null +++ b/docs/reports/2026-09-27-c0-corpus-v2.md @@ -0,0 +1,179 @@ +--- +version: "0.1.0b" +created_at: "2026-09-27T12:00:00+07:00,Claude,working-tree" +last_update: "2026-09-27T12:00:00+07:00,Claude" +status: "candidate" +superseded_by: null +attributes: + domain: "genesis-knowledge-system" + doc_type: "baseline-evidence" + scope: "C0.4 golden corpus registry v2: replayable request fixtures, golden transcripts and a corpus runner" + baseline_sha: "f50116abdc3fe606851df4d21697027e252341c7" +--- + +# C0.4 golden corpus v2 + +## Status + +GKS-MIG-002 was the last P1 row that needed an owner decision about the corpus +([P1 report](2026-09-27-p1-c0-closure.md)). The owner chose to ship it. The +C0.4 corpus is now a replayable artifact rather than a list of hashes: + +- registry `c0-qualification/v2` replaces v1; +- the result manifest is `PASS_WITH_LIMITATIONS`: PASS 24, NOT_RUN 1; +- `productionReady` and `deploymentAuthorized` stay `false`. + +## What was wrong with v1 + +The v1 registry held a request hash and an expected-result hash for each case, +but not the request or the result. Nothing could recompute those hashes, so +they were labels, not evidence. Each PASS in the manifest pointed at ordinary +contract tests. Two further problems: + +- the registry's own `status` field still said `NOT_RUN` for the 17 tool + cases while the manifest said `PASS`; +- the GenesisRAG17 receipts case was `NOT_RUN` as a whole, although only its + Tier-4 physical readback was out of reach. + +## What v2 is + +| Part | Path | Role | +|---|---|---| +| Builder | `scripts/c0-corpus/build-cases.mjs` | Defines every case, both its metadata and its steps. It writes the request fixtures and the registry deterministically. | +| Request fixtures | `tests/fixtures/c0-qualification/cases/.json` | The exact frames to send, in order, with server environment and fixture credentials | +| Golden transcripts | `tests/fixtures/c0-qualification/expected/.json` | The normalized answer to every step | +| Runner | `scripts/c0-corpus/runner.mjs`, `scripts/run-c0-corpus.mjs` | Replays each case against a real `gks-server` stdio process on a fresh SQLite store | +| Registry | `tests/fixtures/c0-qualification/registry.json` | Case metadata plus the SHA-256 of each canonical fixture and transcript | + +A case is a list of steps: + +- `call` sends a JSON-RPC frame. +- `raw` sends raw bytes, for transport denials. +- `restart` restarts the server on the same store. +- `kill-after-commit` sends a frame, waits until a read-only SQL probe sees + the durable write, then SIGKILLs the process without reading the reply. +- `store-exec` runs SQL from a second connection, to inject a fault. +- `store-query` reads rows and records them. + +### What a replay checks + +A replay passes only if all of the following hold: + +1. the request fixture still hashes to the registry; +2. every step's intent annotation holds, for example `ok`, a named tool error + such as `gks_conflict`, a protocol error message, or a partial + `structuredContent` match; +3. every stdout line is a JSON-RPC 2.0 frame and no frame arrives unrequested; +4. no fixture credential appears in stdout, in stderr, or in the SQLite main, + WAL or SHM files; +5. the normalized transcript hashes to the registry. + +The annotations exist so that `--write` cannot quietly re-baseline an answer +that contradicts the purpose of the case. The hash exists so that a change no +annotation mentions still fails. + +### Normalization + +Some values legitimately differ from run to run. The runner replaces three +kinds before hashing: + +- **Server-clock instants** become ``. An instant that the request + itself carried is left alone, so echoed fixture times still count. +- **Measured durations** (`duration_ms`, `processing_time_ms`) become + ``. +- **Clock-derived hashes** (`decisionHash`, and the graph, derived, receipt, + verdict, publication and failure hashes chained from it) become numbered + labels such as ``. Equal values keep equal labels, so + "the replay returned the committed decision" stays visible in the + transcript. + +A decision's facts carry the transaction time, so its hash depends on the +server clock. A request that needs such a value binds it from an earlier +response with `{"$bind": "."}`; every other request value is +literal. + +### Guarding against unnoticed changes + +`--write` records a case only if two consecutive runs produce identical +transcripts, so a volatile field that normalization misses cannot become the +golden result. A contract test rebuilds the fixtures and fails if they differ +from the committed files, so a change to a shared test helper (`makeBatch`, +`promotion`) cannot silently change the corpus. + +## Cases + +The registry has 25 cases, of which 24 are runnable. + +| Case | Replays | +|---|---| +| C0.4-TOOL-001 to 017 | Each of the 17 public tools, preceded by the setup it needs. `initialize` and `tools/list` pin the protocol surface and the registry. The contract test requires each tool case to call its own tool. | +| API010-REPLAY | promote, restart, identical replay (idempotent), `gks_conflict` for a changed payload; one promotion row and one evidence row | +| TENANT-WALL | Tenant and tenantless rows never cross, `portfolio-shared` does not bypass the wall, and cross-tenant reads return `gks_scope_denied` | +| AUTH-DENIAL | Secure mode. Missing auth, a forged credential, the wrong role, a stale version and a forged scope digest are all denied and write nothing. A valid envelope is accepted, and the MSP credential never reaches output or the store. | +| TRANSPORT-DENIAL | Malformed JSON, duplicate keys, a batch, 33-deep nesting, an oversized frame, invalid UTF-8 and a non-finite number are each rejected. The server keeps serving afterwards. | +| GENESISRAG17-RECEIPTS | A full chain through publication. A duplicate graph receipt is idempotent. A wrong decision hash, wrong scope, forged stage identity and wrong role are each denied. A second batch whose Stage 15 fails gets a gate verdict `FAIL` with `allowPublication: false`. | +| TIER4-READBACK | **NOT_RUN.** GenesisBlockDB's physical readback cannot run inside GKS, which never calls outward. This case was split out of the v1 receipts case. | +| BACKEND-FAILURE | The last table a promotion writes is dropped from a second connection. The promotion returns `gks_backend_unavailable`, and no entity or promotion row is left behind. | +| LOST-RESPONSE-REPLAY | SIGKILL after the durable commit, for a legacy promote and for a pipeline submit. The replay after a restart is idempotent, a changed payload is `gks_conflict`, and there is one row each. | + +The real-MSP runs recorded at `be97c93` cannot be replayed from this +repository. They move to `externalRuns` in the manifest, keeping their +original date. + +## Evidence that it detects regressions + +Each mutation below was applied to the product code, the corpus was run, and +the mutation was reverted: + +| Mutation | Cases that failed | +|---|---| +| Parse-error message changed | TRANSPORT-DENIAL (golden hash) | +| Replay reports `idempotent: false` | TOOL-012, GENESISRAG17-RECEIPTS (annotation and hash) | +| `aliases` dropped from the entity output | TOOL-003, TOOL-004, TENANT-WALL, AUTH-DENIAL (hash only; no annotation names the field) | +| `normVersion` value changed | the same four (hash only) | +| Server fails to start | all 24, each failing at once with the server's stderr | + +Local runs: + +- `npm run check:corpus` replays all 24 cases in about 3 seconds, stable over 5 + consecutive runs; +- `npm test` gives 288 passed and 2 skipped (MSP suites that need + `MSP_REPO_ROOT`); security 12/12, unit 9/9; +- `check:c0` reports PASS 24 / NOT_RUN 1, and `check:baseline` holds after the + re-lock described below. + +## CI and baseline + +The `c0-gate` slice now runs `check:c0`, `check:baseline` and `check:corpus`. +`tests/integration/c0-corpus.test.mjs` runs the same replay inside `npm test`. +The workflow hash changed, so the baseline lock was re-locked +(`f50116a+working-tree`). + +`check:c0` now also verifies, without running anything, that every fixture and +transcript hashes to the registry. It refuses a PASS for any case that has no +replayable fixture. + +## Maintaining the corpus + +1. Change `scripts/c0-corpus/build-cases.mjs`, or the behaviour a case records. +2. Run `node scripts/c0-corpus/build-cases.mjs`. It rewrites the fixtures and + clears the expected hash of every case whose request changed. +3. Run `node scripts/run-c0-corpus.mjs --write`. It re-baselines the + transcripts, registry hashes and manifest. It refuses if any annotation + fails or two runs disagree. +4. Review the diff of `expected/*.json`. This diff is the behaviour change + being approved. + +## Observation, not changed here + +A gate verdict for a batch with no worker receipt includes the security reason +"retrieval benchmark reported a cross-tenant leak". That reason is misleading: +there was no benchmark at all, and the retrieval dimension already reports +"retrieval benchmark is missing". The golden transcript records the current +text. Correcting it is a behaviour change for a later PR. + +## Change log + +| Version | Date | Status | Summary | Commit Hash | Agent | +|---|---|---|---|---|---| +| 0.1.0b | 2026-09-27 | candidate | C0.4 golden corpus registry v2: replayable fixtures, golden transcripts, runner, CI gate, Tier-4 readback split out | working-tree | Claude | diff --git a/docs/reports/2026-09-27-p1-c0-closure.md b/docs/reports/2026-09-27-p1-c0-closure.md index 259d93c..8175c04 100644 --- a/docs/reports/2026-09-27-p1-c0-closure.md +++ b/docs/reports/2026-09-27-p1-c0-closure.md @@ -1,7 +1,7 @@ --- -version: "0.1.0b" +version: "0.1.1b" created_at: "2026-09-27T10:30:00+07:00,Claude,working-tree" -last_update: "2026-09-27T10:30:00+07:00,Claude" +last_update: "2026-09-27T12:00:00+07:00,Claude" status: "candidate" superseded_by: null attributes: @@ -144,10 +144,11 @@ versioned rollout, not with this closure. | GKS-PIP-008 | a legacy export with an out-of-range cursor returns empty | return `gks_invalid_request`, as the pipeline export does | | GKS-IDN-006 | human repair proof is only an `msp:proof/` prefix | verify it against MSP | | GKS-NFR-006 | the gate trusts benchmark numbers the worker reports | pin a GKS-side benchmark manifest | -| GKS-MIG-002 | the registry holds request and result hashes without payloads, so it cannot be replayed | ship registry v2 with request fixtures and a corpus runner, then re-baseline the hashes | +| GKS-MIG-002 | ~~the registry holds request and result hashes without payloads, so it cannot be replayed~~ | **Done:** registry v2 ships replayable fixtures and a runner; see [the corpus v2 report](2026-09-27-c0-corpus-v2.md) | ## Change log | Version | Date | Status | Summary | Commit Hash | Agent | |---|---|---|---|---|---| | 0.1.0b | 2026-09-27 | candidate | P1 C0 closure: executable baseline lock and CI gate, lost-response replay PASS, IMMEDIATE write transactions and error-code discipline, C0 acceptance evidence | working-tree | Claude | +| 0.1.1b | 2026-09-27 | candidate | GKS-MIG-002 closed by the C0.4 golden corpus v2 | working-tree | Claude | diff --git a/package.json b/package.json index 794ce46..8b6113a 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "test:security": "node --test --test-concurrency=1 tests/security/*.security.mjs", "check:c0": "node scripts/check-c0-qualification.mjs", "check:baseline": "node scripts/check-baseline-lock.mjs", + "check:corpus": "node scripts/run-c0-corpus.mjs", "test:all": "npm test", "pack:client": "npm pack --workspace @freshair129/gks-client-js --dry-run", "desktop": "node apps/wiki-desktop/server.mjs", diff --git a/scripts/c0-corpus/build-cases.mjs b/scripts/c0-corpus/build-cases.mjs new file mode 100644 index 0000000..8bd1a3b --- /dev/null +++ b/scripts/c0-corpus/build-cases.mjs @@ -0,0 +1,486 @@ +// @req GKS-MIG-002, ADR-GKS-C0-QUALIFICATION D4 — builds the C0.4 golden +// corpus request fixtures (registry c0-qualification/v2). +// +// node scripts/c0-corpus/build-cases.mjs +// +// Writes tests/fixtures/c0-qualification/cases/.json and the registry. The +// output is deterministic: tests/contract/c0-golden-registry.test.mjs rebuilds +// it and fails when the committed fixtures differ, so a change to a shared +// test helper cannot silently change the corpus. After a deliberate change, +// rebuild, then re-baseline the expected transcripts with +// `node scripts/run-c0-corpus.mjs --write`. +// +// Pipeline fixtures need values that only exist after a claim: the in-process +// service below is run once to learn the deterministic ones (decision id, +// stage identities, expected readback counts). A value the server derives from +// its own clock (decisionHash and the receipt hashes chained from it) is +// written as a `$bind` to the earlier step's response instead. +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import path from "node:path"; +import { pathToFileURL } from "node:url"; +import { GKS_MSP_AUTH_VERSION, GKS_TOOL_DEFINITIONS, PIPELINE_SCHEMA_VERSION, mspScopeDigest } from "@freshair129/gks-contracts"; +import { createGksService } from "@freshair129/gks-core"; +import { openSqlitePersistence } from "@freshair129/gks-persistence"; +import { promotion } from "../../tests/fixtures/candidates.mjs"; +import { graphReceiptFor, makeBatch, metric, receiptFor } from "../../tests/fixtures/genesisrag17.mjs"; +import { CORPUS_DIR, sha256Canonical } from "./runner.mjs"; + +export const REGISTRY_VERSION = "c0-qualification/v2"; +export const FIXTURE_ID = "gks-c0.4-golden"; +const REGISTRY_PATH = `${CORPUS_DIR}/registry.json`; + +// Fixture-only credentials: not secrets, but the runner still proves they +// never reach process output or the store. +const PIPELINE_RELAY = "c0-fixture-pipeline-relay"; +const MSP_RELAY = "c0-fixture-msp-relay"; + +const LEGACY_SCOPE = { portfolioId: "c0-portfolio", tenantId: "c0-tenant", businessId: "", workspaceId: "", projectId: "", sharing: "private" }; +const TENANTLESS_SCOPE = { ...LEGACY_SCOPE, tenantId: "" }; +const OTHER_TENANT_SCOPE = { ...LEGACY_SCOPE, tenantId: "c0-tenant-b" }; +const PIPELINE_SCOPE = { portfolioId: "c0-portfolio", tenantId: "c0-tenant", businessId: "c0-business", workspaceId: "", agentId: "c0-agent", visibility: "private" }; +const BASE_ENV = { GKS_DEFAULT_PORTFOLIO_ID: "c0-portfolio", GKS_PIPELINE_RELAY_CREDENTIAL: PIPELINE_RELAY }; + +const source = { relayCredential: PIPELINE_RELAY, authenticatedPrincipal: { principalId: "source-principal", role: "source", scope: PIPELINE_SCOPE } }; +const worker = { relayCredential: PIPELINE_RELAY, authenticatedPrincipal: { principalId: "worker-principal", role: "worker", scope: PIPELINE_SCOPE } }; +const bind = (reference) => ({ $bind: reference }); + +// One case's steps, with JSON-RPC ids numbered from 1. +function steps() { + let nextId = 1; + const list = []; + const frame = (method, params) => ({ jsonrpc: "2.0", id: nextId++, method, ...(params === undefined ? {} : { params }) }); + return { + list, + protocol(method, params, expect) { + list.push({ kind: "call", frame: frame(method, params), ...(expect ? { expect } : {}) }); + }, + call(name, tool, args, expect, meta) { + list.push({ kind: "call", ...(name ? { name } : {}), frame: frame("tools/call", { name: tool, arguments: args, ...(meta ? { _meta: meta } : {}) }), ...(expect ? { expect } : {}) }); + }, + raw(parts, expect) { + list.push({ kind: "raw", parts, expect }); + }, + killAfterCommit(tool, args, until) { + list.push({ kind: "kill-after-commit", frame: frame("tools/call", { name: tool, arguments: args }), until }); + }, + restart() { + list.push({ kind: "restart" }); + }, + storeExec(sql) { + list.push({ kind: "store-exec", sql }); + }, + storeQuery(sql, params, rows) { + list.push({ kind: "store-query", sql, params, expect: { rows } }); + }, + }; +} + +function legacyPromotion(key, overrides = {}) { + return promotion({ idempotency_key: key, run_id: `${key}-run`, provenance_ref: `msp:proof/${key}`, scope: LEGACY_SCOPE, ...overrides }); +} + +const conflictingCandidate = { entities: [{ candidateRef: "FEAT-LINE-LINKING", type: "FEAT", title: "A wholly different feature" }], relations: [] }; + +// Runs one batch through the in-process service to learn the deterministic +// parts of every later request. +async function pipelineChain(batch) { + const dir = mkdtempSync(path.join(tmpdir(), "gks-c0-build-")); + const persistence = openSqlitePersistence({ dbPath: path.join(dir, "gks.sqlite") }); + try { + const service = createGksService({ persistence, pipelineRelayCredential: PIPELINE_RELAY }); + await service.pipelineSubmit({ schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, batch, ...source }); + const { decisions } = await service.pipelineClaim({ schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, ...worker }); + const decision = decisions.find((candidate) => candidate.batchId === batch.batchId); + const graphReceipt = graphReceiptFor(decision); + const graphResult = await service.pipelineGraphReceipt({ receipt: graphReceipt, ...worker }); + const receipt = receiptFor(decision, graphResult, graphReceipt); + return { decision, graphReceipt, receipt }; + } finally { + persistence.close(); + rmSync(dir, { recursive: true, force: true }); + } +} + +// Steps for one batch, up to and including `through`. Step names are prefixed +// so a case can run more than one batch; `afterGraph` inserts a case's own +// steps between the graph receipt and the worker receipt. +async function pipelineSteps(s, batch, through, { prefix = "", afterGraph } = {}) { + const order = ["submit", "claim", "graph", "write", "gate", "publication", "evidence"]; + const upTo = order.indexOf(through); + const { decision, graphReceipt, receipt } = await pipelineChain(batch); + const named = (step) => `${prefix}${step}`; + const decisionHash = bind(`${named("claim")}.result.structuredContent.decisions.0.decisionHash`); + s.call(named("submit"), "gks_pipeline_submit", { schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, batch, ...source }, { ok: true, match: { batchId: batch.batchId, status: "PENDING", idempotent: false } }); + if (upTo < 1) return { decision, decisionHash }; + s.call(named("claim"), "gks_pipeline_claim", { schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, ...worker }, { ok: true, match: { decisions: [{ batchId: batch.batchId, decisionId: decision.decisionId }] } }); + if (upTo < 2) return { decision, decisionHash }; + const boundGraphReceipt = { ...graphReceipt, decisionHash }; + s.call(named("graph"), "gks_pipeline_graph_receipt", { receipt: boundGraphReceipt, ...worker }, { ok: true, match: { accepted: true, idempotent: false } }); + afterGraph?.({ boundGraphReceipt }); + if (upTo < 3) return { decision, decisionHash, boundGraphReceipt }; + const boundReceipt = { + ...receipt, + decisionHash, + graphReceiptHash: bind(`${named("graph")}.result.structuredContent.graphReceiptHash`), + derivedHash: bind(`${named("graph")}.result.structuredContent.derivedHash`), + }; + s.call(named("write"), "gks_pipeline_write_receipt", { receipt: boundReceipt, ...worker }, { ok: true, match: { accepted: true, idempotent: false } }); + if (upTo < 4) return { decision, decisionHash }; + s.call(named("gate"), "gks_pipeline_gate", { schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, decisionId: decision.decisionId, decisionHash, ...worker }, { ok: true, match: { verdict: { verdict: "PASS", allowPublication: true } } }); + if (upTo < 5) return { decision, decisionHash }; + const publication = { + schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, runId: batch.runId, decisionId: decision.decisionId, decisionHash, + snapshotId: receipt.snapshotId, generation: receipt.generation, receiptHash: bind(`${named("write")}.result.structuredContent.receiptHash`), + publishedAt: "2026-09-07T15:00:03.000Z", pointerHash: "c".repeat(64), modelRevision: receipt.model.revision, transactionFrontier: receipt.transaction.frontier, readback: { ok: true }, + }; + s.call(named("publication"), "gks_pipeline_publication_receipt", { receipt: publication, ...worker }, { ok: true, match: { accepted: true, idempotent: false } }); + if (upTo < 6) return { decision, decisionHash }; + s.call(named("evidence"), "gks_pipeline_evidence", { schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, runId: batch.runId, ...source }, { ok: true }); + return { decision, decisionHash }; +} + +function stageFailure(batch, decision, decisionHash) { + return { + schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, runId: batch.runId, decisionId: decision.decisionId, decisionHash, + stage: decision.stages.find((stage) => stage.stageNumber === 15), startedAt: "2026-09-07T15:00:01.000Z", finishedAt: "2026-09-07T15:00:01.100Z", + metrics: metric({ error_count: 1 }), error: { code: "INDEX_WRITE_FAILED", message: "C0 fixture index write failure" }, ...worker, + }; +} + +const batchFor = (id) => makeBatch({ id, scope: PIPELINE_SCOPE }); + +// --- The 17 tool cases: each tool's accepted request and response envelope. +const TOOL_STEPS = { + async gks_health(s) { + s.protocol("initialize", {}, { ok: true }); + s.protocol("tools/list", {}, { ok: true }); + s.call("health", "gks_health", {}, { ok: true, match: { service: "gks", state: "ready" } }); + }, + async gks_knowledge_promote(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-tool-promote"), { ok: true, match: { idempotent: false } }); + s.call("replay", "gks_knowledge_promote", legacyPromotion("c0-tool-promote"), { ok: true, match: { idempotent: true } }); + }, + async gks_search(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-tool-search"), { ok: true }); + s.call("search", "gks_search", { query: "LINE", scope: LEGACY_SCOPE }, { ok: true }); + }, + async gks_entity_get(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-tool-entity"), { ok: true }); + s.call("entity", "gks_entity_get", { ref: bind("promote.result.structuredContent.canonical_mappings.0.canonicalRef"), scope: LEGACY_SCOPE }, { ok: true, match: { candidateRef: "FEAT-LINE-LINKING" } }); + }, + async gks_relations_get(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-tool-relations"), { ok: true }); + s.call("relations", "gks_relations_get", { ref: bind("promote.result.structuredContent.canonical_mappings.0.canonicalRef"), scope: LEGACY_SCOPE }, { ok: true, match: [{ relationType: "DEPENDS_ON" }] }); + }, + async gks_artifact_link(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-tool-artifact"), { ok: true }); + s.call("link", "gks_artifact_link", { knowledgeRef: bind("promote.result.structuredContent.canonical_mappings.0.canonicalRef"), artifactRef: "artifact:c0/spec-line-linking", relationType: "DESCRIBED_BY", evidenceRef: "msp:proof/c0-tool-artifact-link", scope: LEGACY_SCOPE }, { ok: true, match: { relationType: "DESCRIBED_BY" } }); + }, + async gks_review_list(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-tool-review-list"), { ok: true }); + s.call("conflict", "gks_knowledge_promote", legacyPromotion("c0-tool-review-list-2", { source_snapshot_hash: "c".repeat(64), candidate: conflictingCandidate }), { ok: true, match: { canonical_mappings: [{ resolution: { outcome: "REVIEW_REQUIRED" } }] } }); + s.call("list", "gks_review_list", { scope: LEGACY_SCOPE }, { ok: true, match: [{ outcome: "REVIEW_REQUIRED" }] }); + }, + async gks_review_apply(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-tool-review-apply"), { ok: true }); + s.call("conflict", "gks_knowledge_promote", legacyPromotion("c0-tool-review-apply-2", { source_snapshot_hash: "c".repeat(64), candidate: conflictingCandidate }), { ok: true }); + s.call("list", "gks_review_list", { scope: LEGACY_SCOPE }, { ok: true }); + s.call("apply", "gks_review_apply", { + action: "BIND", provenanceRef: "msp:proof/c0-tool-review-apply-human", scope: LEGACY_SCOPE, + mentionId: bind("list.result.structuredContent.0.mentionId"), canonicalRef: bind("promote.result.structuredContent.canonical_mappings.0.canonicalRef"), + }, { ok: true }); + s.call("after", "gks_review_list", { scope: LEGACY_SCOPE }, { ok: true, match: [] }); + }, + async gks_stage_evidence_export(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-tool-export"), { ok: true }); + s.call("promote2", "gks_knowledge_promote", legacyPromotion("c0-tool-export-2", { source_snapshot_hash: "d".repeat(64) }), { ok: true }); + s.call("page1", "gks_stage_evidence_export", { scope: LEGACY_SCOPE, limit: 1 }, { ok: true, match: { next_cursor: 1 } }); + s.call("page2", "gks_stage_evidence_export", { scope: LEGACY_SCOPE, since_cursor: 1 }, { ok: true, match: { next_cursor: 2 } }); + }, + async gks_pipeline_submit(s) { + const batch = batchFor("c0-submit"); + await pipelineSteps(s, batch, "submit"); + s.call("replay", "gks_pipeline_submit", { schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, batch, ...source }, { ok: true, match: { idempotent: true } }); + }, + async gks_pipeline_claim(s) { await pipelineSteps(s, batchFor("c0-claim"), "claim"); }, + async gks_pipeline_graph_receipt(s) { + const { boundGraphReceipt } = await pipelineSteps(s, batchFor("c0-graph"), "graph"); + s.call("replay", "gks_pipeline_graph_receipt", { receipt: boundGraphReceipt, ...worker }, { ok: true, match: { accepted: true, idempotent: true } }); + }, + async gks_pipeline_stage_failure(s) { + const batch = batchFor("c0-failure"); + const { decision, decisionHash } = await pipelineSteps(s, batch, "graph"); + s.call("failure", "gks_pipeline_stage_failure", stageFailure(batch, decision, decisionHash), { ok: true, match: { accepted: true, idempotent: false, stage: { stageNumber: 15 } } }); + }, + async gks_pipeline_write_receipt(s) { await pipelineSteps(s, batchFor("c0-write"), "write"); }, + async gks_pipeline_gate(s) { await pipelineSteps(s, batchFor("c0-gate"), "gate"); }, + async gks_pipeline_publication_receipt(s) { await pipelineSteps(s, batchFor("c0-publication"), "publication"); }, + async gks_pipeline_evidence(s) { await pipelineSteps(s, batchFor("c0-evidence"), "evidence"); }, +}; + +const TOOL_EVIDENCE = { testPaths: ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], reason: "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." }; +const LEDGER_BY_TOOL = { gks_stage_evidence_export: "stage_evidence" }; + +function toolCase(tool, index) { + const pipeline = tool.startsWith("gks_pipeline_"); + return { + id: `C0.4-TOOL-${String(index + 1).padStart(3, "0")}`, + category: "tool", + tool, + env: BASE_ENV, + secrets: [PIPELINE_RELAY], + normalizedScope: pipeline ? PIPELINE_SCOPE : LEGACY_SCOPE, + expected: { responseEnvelope: "jsonrpc-result-or-error", opaqueRefs: [], receiptHashes: [], ledger: LEDGER_BY_TOOL[tool] ?? (pipeline ? "pipeline_evidence" : null), cursorOutcome: "replayed", errorCode: null, assertions: ["registered tool and response envelope are preserved"] }, + evidence: TOOL_EVIDENCE, + build: TOOL_STEPS[tool], + }; +} + +function mspAuth(scopeForDigest, overrides = {}) { + return { gksMspAuth: { version: GKS_MSP_AUTH_VERSION, principalId: "msp-runtime", role: "msp", relayCredential: MSP_RELAY, scopeDigest: mspScopeDigest(scopeForDigest), ...overrides } }; +} + +const SCENARIO_CASES = [ + { + id: "C0.4-API010-REPLAY", + category: "api-010-replay", + env: BASE_ENV, + secrets: [PIPELINE_RELAY], + normalizedScope: LEGACY_SCOPE, + expected: { responseEnvelope: "api-010-compatible", opaqueRefs: ["", ""], receiptHashes: [], ledger: "stage_evidence", cursorOutcome: "idempotent-replay", errorCode: "gks_conflict", assertions: ["inner govibe-knowledge-candidate/v1 payload is unchanged", "replay after a restart returns the original opaque refs", "replay writes no duplicate evidence", "a changed payload under the same key is a conflict"] }, + evidence: { testPaths: ["tests/integration/stdio-restart.test.mjs", "tests/integration/msp-provider-compatibility.test.mjs", "tests/integration/msp-service-chain.test.mjs"], reason: "Replayed by the corpus runner across a server restart; the MSP provider and service-chain suites cover the same payload through MSP." }, + async build(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-api010"), { ok: true, match: { idempotent: false } }); + s.restart(); + s.call("replay", "gks_knowledge_promote", legacyPromotion("c0-api010"), { ok: true, match: { idempotent: true } }); + s.call("conflict", "gks_knowledge_promote", legacyPromotion("c0-api010", { source_snapshot_hash: "b".repeat(64) }), { toolError: "gks_conflict" }); + s.storeQuery("SELECT COUNT(*) AS promotions FROM promotions WHERE idempotency_key = ?", ["c0-api010"], [{ promotions: 1 }]); + s.storeQuery("SELECT COUNT(*) AS evidence FROM stage_evidence", [], [{ evidence: 1 }]); + }, + }, + { + id: "C0.4-TENANT-WALL", + category: "tenant-wall", + env: BASE_ENV, + secrets: [PIPELINE_RELAY], + normalizedScope: TENANTLESS_SCOPE, + expected: { responseEnvelope: "scoped-result-or-denial", opaqueRefs: [""], receiptHashes: [], ledger: "canonical-knowledge", cursorOutcome: "no-cross-tenant-cursor", errorCode: "gks_scope_denied", assertions: ["empty tenant matches only empty tenant", "tenanted and tenantless rows never cross", "portfolio sharing does not bypass the tenant wall"] }, + evidence: { testPaths: ["tests/security/c0-tenant-wall.security.mjs", "tests/security/cross-tenant-deny.security.mjs", "tests/contract/stage9-persistence.test.mjs"], reason: "Replayed by the corpus runner; the security suites cover the same wall in-process. Forged scope digests are the auth-denial case." }, + async build(s) { + s.call("tenant", "gks_knowledge_promote", legacyPromotion("c0-wall-tenant"), { ok: true }); + s.call("tenantless", "gks_knowledge_promote", legacyPromotion("c0-wall-tenantless", { scope: TENANTLESS_SCOPE }), { ok: true }); + s.call("searchTenant", "gks_search", { query: "LINE", scope: LEGACY_SCOPE }, { ok: true, match: [{ scope: { tenantId: "c0-tenant" } }] }); + s.call("searchTenantless", "gks_search", { query: "LINE", scope: TENANTLESS_SCOPE }, { ok: true, match: [{ scope: { tenantId: "" } }] }); + s.call("searchOther", "gks_search", { query: "LINE", scope: OTHER_TENANT_SCOPE }, { ok: true, match: [] }); + s.call("searchShared", "gks_search", { query: "LINE", scope: { ...OTHER_TENANT_SCOPE, sharing: "portfolio-shared" } }, { ok: true, match: [] }); + s.call("crossIntoTenantless", "gks_entity_get", { ref: bind("tenantless.result.structuredContent.canonical_mappings.0.canonicalRef"), scope: LEGACY_SCOPE }, { toolError: "gks_scope_denied" }); + s.call("crossIntoTenant", "gks_entity_get", { ref: bind("tenant.result.structuredContent.canonical_mappings.0.canonicalRef"), scope: TENANTLESS_SCOPE }, { toolError: "gks_scope_denied" }); + s.call("crossFromOther", "gks_relations_get", { ref: bind("tenant.result.structuredContent.canonical_mappings.0.canonicalRef"), scope: OTHER_TENANT_SCOPE }, { toolError: "gks_scope_denied" }); + }, + }, + { + id: "C0.4-AUTH-DENIAL", + category: "auth-denial", + env: { ...BASE_ENV, GKS_MSP_AUTH_REQUIRED: "1", GKS_MSP_RELAY_CREDENTIAL: MSP_RELAY }, + secrets: [PIPELINE_RELAY, MSP_RELAY], + normalizedScope: TENANTLESS_SCOPE, + expected: { responseEnvelope: "typed-denial", opaqueRefs: [], receiptHashes: [], ledger: null, cursorOutcome: "no-persistence", errorCode: "gks_scope_denied", assertions: ["missing, forged, stale, wrong-role and scope-mismatched MSP auth are denied", "denials write nothing", "auth material is not persisted or logged"] }, + evidence: { testPaths: ["tests/contract/c0-msp-auth.test.mjs", "tests/integration/msp-provider-compatibility.test.mjs", "tests/integration/msp-service-chain.test.mjs"], reason: "Replayed by the corpus runner in secure mode; the MSP suites cover the same envelope from the real MSP provider." }, + async build(s) { + const { scope: _scope, ...inner } = legacyPromotion("c0-auth"); + const defaultScope = { ...TENANTLESS_SCOPE }; + s.call("health", "gks_health", {}, { ok: true }); + s.call("missing", "gks_knowledge_promote", inner, { toolError: "gks_scope_denied" }); + s.call("forgedCredential", "gks_knowledge_promote", inner, { toolError: "gks_scope_denied" }, mspAuth(defaultScope, { relayCredential: `${MSP_RELAY}-forged` })); + s.call("wrongRole", "gks_knowledge_promote", inner, { toolError: "gks_scope_denied" }, mspAuth(defaultScope, { role: "worker" })); + s.call("staleVersion", "gks_knowledge_promote", inner, { toolError: "gks_scope_denied" }, mspAuth(defaultScope, { version: "gks-msp-auth/v0" })); + s.call("forgedScope", "gks_knowledge_promote", inner, { toolError: "gks_scope_denied" }, mspAuth({ ...defaultScope, tenantId: "c0-tenant" })); + s.call("searchUnauthenticated", "gks_search", { query: "LINE", scope: defaultScope }, { toolError: "gks_scope_denied" }); + s.storeQuery("SELECT COUNT(*) AS promotions FROM promotions", [], [{ promotions: 0 }]); + s.call("accepted", "gks_knowledge_promote", inner, { ok: true, match: { idempotent: false } }, mspAuth(defaultScope)); + s.call("search", "gks_search", { query: "LINE", scope: defaultScope }, { ok: true }, mspAuth(defaultScope)); + s.storeQuery("SELECT COUNT(*) AS promotions FROM promotions", [], [{ promotions: 1 }]); + }, + }, + { + id: "C0.4-TRANSPORT-DENIAL", + category: "transport-denial", + env: BASE_ENV, + secrets: [PIPELINE_RELAY], + normalizedScope: LEGACY_SCOPE, + expected: { responseEnvelope: "protocol-error", opaqueRefs: [], receiptHashes: [], ledger: null, cursorOutcome: "no-persistence", errorCode: null, assertions: ["oversized, malformed, invalid UTF-8, deep, duplicate-key, non-finite-number and batch frames are denied", "stdout contains protocol frames only", "the server keeps serving after every denial"] }, + evidence: { testPaths: ["tests/contract/c0-transport-bounds.test.mjs", "tests/integration/stdio-restart.test.mjs"], reason: "Replayed by the corpus runner against the real stdio transport; the runner rejects any stdout line that is not a JSON-RPC frame." }, + async build(s) { + let deep = "0"; + for (let depth = 0; depth < 33; depth += 1) deep = `[${deep}]`; + s.raw([{ text: "{not json\n" }], { protocolError: true }); + s.raw([{ text: '{"jsonrpc":"2.0","id":1,"method":"initialize","method":"tools/list"}\n' }], { protocolError: true }); + s.raw([{ text: `${JSON.stringify([{ jsonrpc: "2.0", id: 2, method: "initialize" }])}\n` }], { protocolError: true, errorMessage: "JSON-RPC batch requests are unsupported." }); + s.raw([{ text: `{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"gks_health","arguments":${deep}}}\n` }], { protocolError: true, errorMessage: "JSON depth exceeds the configured limit." }); + s.raw([{ text: '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"gks_health","arguments":{"padding":"' }, { repeat: "x", count: 1_048_576 }, { text: '"}}}\n' }], { protocolError: true, errorMessage: "Request frame exceeds the configured limit." }); + s.raw([{ text: '{"jsonrpc":"2.0","id":5,"method":"tools/list","params":{"x":"' }, { base64: Buffer.from([0xc3, 0x28]).toString("base64") }, { text: '"}}\n' }], { protocolError: true }); + s.raw([{ text: '{"jsonrpc":"2.0","id":6,"method":"tools/list","params":{"x":1e400}}\n' }], { protocolError: true }); + s.storeQuery("SELECT COUNT(*) AS promotions FROM promotions", [], [{ promotions: 0 }]); + s.call("alive", "gks_health", {}, { ok: true, match: { state: "ready" } }); + }, + }, + { + id: "C0.4-GENESISRAG17-RECEIPTS", + category: "genesisrag17-receipts", + env: BASE_ENV, + secrets: [PIPELINE_RELAY], + normalizedScope: PIPELINE_SCOPE, + expected: { responseEnvelope: "pipeline-result-or-denial", opaqueRefs: ["", ""], receiptHashes: ["", "", ""], ledger: "pipeline_evidence", cursorOutcome: "ordered-stage-cursors", errorCode: null, assertions: ["receipts remain ordered and immutable", "wrong hash, scope, or stage is denied", "duplicate receipt is idempotent", "failed terminal state blocks publication"] }, + evidence: { testPaths: ["tests/contract/pipeline-genesisrag17.test.mjs"], reason: "The GKS side of the receipt protocol, replayed by the corpus runner with frozen Tier-4 receipts. Physical Tier-4 readback is the separate C0.4-TIER4-READBACK case." }, + async build(s) { + // One batch through publication, with the denials inserted after its + // graph receipt: none of them may disturb the receipts that follow. + await pipelineSteps(s, batchFor("c0-receipts"), "evidence", { + afterGraph({ boundGraphReceipt }) { + s.call("graphReplay", "gks_pipeline_graph_receipt", { receipt: boundGraphReceipt, ...worker }, { ok: true, match: { idempotent: true } }); + s.call("wrongHash", "gks_pipeline_graph_receipt", { receipt: { ...boundGraphReceipt, decisionHash: "0".repeat(64) }, ...worker }, { toolError: "gks_conflict" }); + s.call("wrongScope", "gks_pipeline_graph_receipt", { receipt: { ...boundGraphReceipt, scope: { ...PIPELINE_SCOPE, tenantId: "c0-tenant-b" } }, ...worker }, { toolError: "gks_scope_denied" }); + s.call("wrongStage", "gks_pipeline_graph_receipt", { receipt: { ...boundGraphReceipt, stages: boundGraphReceipt.stages.map((stage) => (stage.stageNumber === 13 ? { ...stage, attemptId: "c0-forged-attempt" } : stage)) }, ...worker }, { toolError: "gks_conflict" }); + s.call("sourceRole", "gks_pipeline_graph_receipt", { receipt: boundGraphReceipt, ...worker, authenticatedPrincipal: { ...worker.authenticatedPrincipal, role: "source" } }, { toolError: "gks_scope_denied" }); + }, + }); + // A second batch whose Stage 15 fails: the gate answers FAIL and refuses + // publication. + const failed = batchFor("c0-receipts-failed"); + const failedChain = await pipelineSteps(s, failed, "graph", { prefix: "failed-" }); + s.call("failure", "gks_pipeline_stage_failure", stageFailure(failed, failedChain.decision, failedChain.decisionHash), { ok: true, match: { accepted: true } }); + s.call("gateAfterFailure", "gks_pipeline_gate", { schemaVersion: PIPELINE_SCHEMA_VERSION, scope: failed.scope, decisionId: failedChain.decision.decisionId, decisionHash: failedChain.decisionHash, ...worker }, { ok: true, match: { verdict: { verdict: "FAIL", allowPublication: false } } }); + s.call("failedEvidence", "gks_pipeline_evidence", { schemaVersion: PIPELINE_SCHEMA_VERSION, scope: failed.scope, runId: failed.runId, ...source }, { ok: true }); + }, + }, + { + id: "C0.4-TIER4-READBACK", + category: "genesisrag17-receipts", + runnable: false, + normalizedScope: PIPELINE_SCOPE, + expected: { responseEnvelope: "pipeline-result-or-denial", opaqueRefs: [], receiptHashes: ["", "", ""], ledger: "pipeline_evidence", cursorOutcome: "not-run", errorCode: null, assertions: ["GenesisBlockDB physical graph, index and publication readback match the GKS receipts"] }, + evidence: { testPaths: [], reason: "Physical Tier-4 readback needs a running GenesisBlockDB worker. GKS never calls outward (ADR-GKS-BOUNDARY), so this cannot run inside the GKS corpus and stays NOT_RUN." }, + }, + { + id: "C0.4-BACKEND-FAILURE", + category: "backend-failure", + env: BASE_ENV, + secrets: [PIPELINE_RELAY], + normalizedScope: LEGACY_SCOPE, + expected: { responseEnvelope: "typed-error", opaqueRefs: [], receiptHashes: [], ledger: null, cursorOutcome: "no-partial-write", errorCode: "gks_backend_unavailable", assertions: ["a storage failure inside a write transaction is a typed gks_backend_unavailable error", "the transaction rolls back: no entity or promotion row is left behind"] }, + evidence: { testPaths: ["tests/contract/server-dispatch.test.mjs", "tests/contract/persistence-error-redaction.test.mjs"], reason: "Replayed by the corpus runner: the last table a promotion writes is dropped from a second connection, so the write fails after its earlier inserts." }, + async build(s) { + s.call("promote", "gks_knowledge_promote", legacyPromotion("c0-backend"), { ok: true }); + s.storeExec("DROP TABLE stage_evidence"); + s.call("failed", "gks_knowledge_promote", legacyPromotion("c0-backend-2", { source_snapshot_hash: "e".repeat(64), candidate: { entities: [{ candidateRef: "C0-BACKEND-PROBE", type: "ENTITY", title: "Backend probe" }], relations: [] } }), { toolError: "gks_backend_unavailable" }); + s.storeQuery("SELECT COUNT(*) AS entities FROM entities WHERE candidate_ref = ?", ["C0-BACKEND-PROBE"], [{ entities: 0 }]); + s.storeQuery("SELECT COUNT(*) AS promotions FROM promotions WHERE idempotency_key = ?", ["c0-backend-2"], [{ promotions: 0 }]); + s.call("alive", "gks_health", {}, { ok: true }); + }, + }, + { + id: "C0.4-LOST-RESPONSE-REPLAY", + category: "lost-response-replay", + env: BASE_ENV, + secrets: [PIPELINE_RELAY], + normalizedScope: PIPELINE_SCOPE, + expected: { responseEnvelope: "idempotent-replay", opaqueRefs: ["", ""], receiptHashes: [], ledger: "pipeline_evidence", cursorOutcome: "same-durable-result", errorCode: "gks_conflict", assertions: ["a response lost after the durable commit can be replayed", "replay returns the committed result without a duplicate write", "a changed payload under the same key is a conflict"] }, + evidence: { testPaths: ["tests/integration/lost-response-replay.test.mjs", "tests/integration/stdio-restart.test.mjs"], reason: "Replayed by the corpus runner: the server is SIGKILLed once the write is durable and before the response is read." }, + async build(s) { + const request = legacyPromotion("c0-lost"); + s.killAfterCommit("gks_knowledge_promote", request, { sql: "SELECT knowledge_ref, source_hash FROM promotions WHERE idempotency_key = ?", params: ["c0-lost"] }); + s.restart(); + s.call("replay", "gks_knowledge_promote", request, { ok: true, match: { idempotent: true } }); + s.call("conflict", "gks_knowledge_promote", { ...request, source_snapshot_hash: "b".repeat(64) }, { toolError: "gks_conflict" }); + const batch = batchFor("c0-lost-submit"); + const submit = { schemaVersion: PIPELINE_SCHEMA_VERSION, scope: batch.scope, batch, ...source }; + s.killAfterCommit("gks_pipeline_submit", submit, { sql: "SELECT batch_id, decision_id FROM pipeline_batches WHERE idempotency_key = ?", params: [batch.idempotencyKey] }); + s.restart(); + s.call("submitReplay", "gks_pipeline_submit", submit, { ok: true, match: { batchId: batch.batchId, status: "PENDING", idempotent: true } }); + s.storeQuery("SELECT (SELECT COUNT(*) FROM promotions WHERE idempotency_key = ?) AS promotions, (SELECT COUNT(*) FROM pipeline_batches WHERE idempotency_key = ?) AS batches", ["c0-lost", batch.idempotencyKey], [{ promotions: 1, batches: 1 }]); + }, + }, +]; + +function stripCaseDefinition({ build: _build, env: _env, secrets: _secrets, ...metadata }) { + return metadata; +} + +/** Builds every case fixture and the registry skeleton (without expected hashes). */ +export async function buildCorpus() { + const definitions = [...GKS_TOOL_DEFINITIONS.map((tool, index) => toolCase(tool.name, index)), ...SCENARIO_CASES]; + const fixtures = {}; + const cases = []; + for (const definition of definitions) { + const metadata = stripCaseDefinition(definition); + const runnable = definition.runnable !== false; + if (runnable) { + const s = steps(); + await definition.build(s); + fixtures[definition.id] = { id: definition.id, fixtureVersion: REGISTRY_VERSION, env: definition.env, secrets: definition.secrets, steps: s.list }; + } + cases.push({ + id: definition.id, + fixtureId: FIXTURE_ID, + contractVersion: REGISTRY_VERSION, + category: metadata.category, + ...(metadata.tool ? { tool: metadata.tool } : {}), + runnable, + fixture: runnable ? `cases/${definition.id}.json` : null, + expectedResult: runnable ? `expected/${definition.id}.json` : null, + requestSha256: runnable ? sha256Canonical(fixtures[definition.id]) : null, + expectedResultSha256: null, + normalizedScope: metadata.normalizedScope, + expected: metadata.expected, + evidence: metadata.evidence, + }); + } + const registry = { + registryVersion: REGISTRY_VERSION, + supersedes: "c0-qualification/v1", + fixtureId: FIXTURE_ID, + profile: "C0.4", + statusVocabulary: ["PASS", "FAIL", "NOT_RUN", "BLOCKED"], + categories: ["tool", "api-010-replay", "tenant-wall", "auth-denial", "transport-denial", "genesisrag17-receipts", "backend-failure", "lost-response-replay"], + provenance: { + adr: "docs/ADR-GKS-C0-QUALIFICATION.md", + toolDefinitions: "packages/gks-contracts/src/tool-definitions.mjs", + builder: "scripts/c0-corpus/build-cases.mjs", + runner: "scripts/run-c0-corpus.mjs", + runtime: "gks-server stdio process, fresh SQLite store per case", + normalization: "server-clock instants, measured durations and clock-derived hashes are replaced by stable labels before hashing", + containsSecrets: false, + externalEndpoints: false, + }, + cases, + }; + return { registry, fixtures }; +} + +function writeJson(root, relativePath, value) { + const file = path.join(root, relativePath); + mkdirSync(path.dirname(file), { recursive: true }); + writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`); +} + +async function main() { + const root = process.cwd(); + const { registry, fixtures } = await buildCorpus(); + // Keep an expected hash only while its request fixture is unchanged. + let previous = {}; + try { + previous = Object.fromEntries(JSON.parse(readFileSync(path.join(root, REGISTRY_PATH), "utf8")).cases.map((item) => [item.id, item])); + } catch { /* first build */ } + for (const item of registry.cases) { + const before = previous[item.id]; + if (before && before.requestSha256 === item.requestSha256) item.expectedResultSha256 = before.expectedResultSha256 ?? null; + } + for (const [id, fixture] of Object.entries(fixtures)) writeJson(root, `${CORPUS_DIR}/cases/${id}.json`, fixture); + writeJson(root, REGISTRY_PATH, registry); + const stale = registry.cases.filter((item) => item.runnable && !item.expectedResultSha256).map((item) => item.id); + console.log(`Built ${Object.keys(fixtures).length} case fixtures (${registry.cases.length} registry cases).`); + if (stale.length) console.log(`Needs re-baseline (node scripts/run-c0-corpus.mjs --write): ${stale.join(", ")}`); +} + +if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) await main(); diff --git a/scripts/c0-corpus/runner.mjs b/scripts/c0-corpus/runner.mjs new file mode 100644 index 0000000..1fe8b4e --- /dev/null +++ b/scripts/c0-corpus/runner.mjs @@ -0,0 +1,375 @@ +// @req GKS-MIG-002, ADR-GKS-C0-QUALIFICATION D4 — the C0.4 golden corpus +// runner (registry c0-qualification/v2). +// +// Each runnable case is a request fixture (tests/fixtures/c0-qualification/ +// cases/.json): an ordered list of steps replayed against a real +// `gks-server` stdio process on a fresh SQLite store. The runner records one +// transcript entry per step, normalizes the values that legitimately differ +// between runs, and hashes the result. The registry pins the hash of the +// request fixture and of the expected transcript, so an unreviewed change to +// either the requests or the server's answers fails the corpus. +// +// Step kinds: +// call send one JSON-RPC frame and wait for the response with its id +// raw send raw bytes (text / base64 / repeated padding) and wait +// for the next frame; used for transport denials +// restart stop the server (if running) and start a fresh process on +// the same store +// kill-after-commit send one frame, wait until a read-only SQL probe sees the +// durable write, SIGKILL the process and never read the reply +// store-exec run SQL on the store from a separate connection (fault +// injection for backend-failure cases) +// store-query read rows from the store and record them +// +// A request value `{"$bind": "."}` is replaced by the value at that +// path in the named step's raw response before the frame is sent: some +// requests must carry a hash the server derived from its own clock. +import Database from "better-sqlite3"; +import { spawn } from "node:child_process"; +import { createHash } from "node:crypto"; +import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import path from "node:path"; +import readline from "node:readline"; +import { canonicalJsonString } from "@freshair129/gks-contracts"; + +export const CORPUS_DIR = "tests/fixtures/c0-qualification"; +const SERVER = "apps/gks-server/bin/gks-server.mjs"; +const STEP_TIMEOUT_MS = 10_000; +const STOP_TIMEOUT_MS = 5_000; +// The server runs with a clean environment so an operator's shell (for +// example an exported GKS_MSP_AUTH_REQUIRED) cannot change a golden result. +const ENV_PASSTHROUGH = ["PATH", "Path", "SystemRoot", "SYSTEMROOT", "TEMP", "TMP", "TMPDIR"]; + +// Hashes the server derives from its own clock (a decision carries the +// transaction time of its facts), so they differ on every run. Each distinct +// value becomes a numbered label, which keeps equality visible: a replay that +// returns the committed decision shows the same label as the first submit. +const VOLATILE_HASH_KEYS = new Map(Object.entries({ + decisionHash: "decisionHash", decision_hash: "decisionHash", + graphReceiptHash: "graphReceiptHash", graph_receipt_hash: "graphReceiptHash", + derivedHash: "derivedHash", derived_hash: "derivedHash", + receiptHash: "receiptHash", receipt_hash: "receiptHash", + verdictHash: "verdictHash", verdict_hash: "verdictHash", + publicationHash: "publicationHash", publication_hash: "publicationHash", + failureHash: "failureHash", failure_hash: "failureHash", +})); +// Measured wall-clock durations. +const DURATION_KEYS = new Set(["duration_ms", "processing_time_ms"]); +const ISO_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/; + +export function sha256Canonical(value) { + return createHash("sha256").update(canonicalJsonString(value), "utf8").digest("hex"); +} + +export function readJson(root, relativePath) { + return JSON.parse(readFileSync(path.join(root, relativePath), "utf8")); +} + +function serverEnv(dbPath, caseEnv) { + const env = {}; + for (const name of ENV_PASSTHROUGH) if (process.env[name] !== undefined) env[name] = process.env[name]; + return { ...env, ...caseEnv, GKS_DB_PATH: dbPath }; +} + +function withTimeout(promise, label, timeoutMs = STEP_TIMEOUT_MS) { + let timer; + const timeout = new Promise((_, reject) => { timer = setTimeout(() => reject(new Error(`${label} timed out after ${timeoutMs} ms`)), timeoutMs); }); + return Promise.race([promise, timeout]).finally(() => clearTimeout(timer)); +} + +function startServer(root, dbPath, caseEnv) { + const child = spawn(process.execPath, [path.join(root, SERVER)], { cwd: root, env: serverEnv(dbPath, caseEnv), stdio: ["pipe", "pipe", "pipe"], shell: false }); + const server = { child, stdout: "", stderr: "", frames: [], waiters: [], violations: [], killed: false }; + server.exited = new Promise((resolve) => child.once("exit", resolve)); + child.once("error", (error) => server.violations.push(`server process error: ${error.message}`)); + child.stderr.on("data", (chunk) => { server.stderr += chunk.toString("utf8"); }); + readline.createInterface({ input: child.stdout, crlfDelay: Infinity }).on("line", (line) => { + server.stdout += `${line}\n`; + let frame; + try { + frame = JSON.parse(line); + } catch { + // stdout carries protocol frames only (ADR-GKS-C0-QUALIFICATION D3). + server.violations.push(`non-JSON stdout line: ${line.slice(0, 120)}`); + return; + } + if (!frame || frame.jsonrpc !== "2.0") server.violations.push(`non-JSON-RPC stdout frame: ${line.slice(0, 120)}`); + server.frames.push(frame); + for (const waiter of [...server.waiters]) waiter(); + }); + return server; +} + +function nextFrame(server, predicate, label) { + // A server that dies fails the step at once, with its stderr tail. + const died = server.exited.then((code) => { + throw new Error(`${label}: server exited (${code ?? server.child.signalCode}) before answering: ${server.stderr.trim().split("\n").slice(-3).join(" | ").slice(0, 300)}`); + }); + return withTimeout(Promise.race([died, new Promise((resolve) => { + const check = () => { + const index = server.frames.findIndex(predicate); + if (index === -1) return; + server.waiters.splice(server.waiters.indexOf(check), 1); + resolve(server.frames.splice(index, 1)[0]); + }; + server.waiters.push(check); + check(); + })]), label); +} + +async function stopServer(server, { kill = false } = {}) { + if (kill) { + server.killed = true; + server.child.kill("SIGKILL"); + } else { + server.child.stdin.end(); + } + try { + await withTimeout(server.exited, "server stop", STOP_TIMEOUT_MS); + } catch { + server.child.kill("SIGKILL"); + await server.exited; + } + // A deliberately killed process may still have flushed the lost response; + // any other frame nobody asked for is a protocol violation. + if (!server.killed && server.frames.length) server.violations.push(`unsolicited stdout frame(s): ${JSON.stringify(server.frames).slice(0, 200)}`); +} + +function lookupBinding(outputs, reference) { + const [stepName, ...segments] = reference.split("."); + if (!Object.prototype.hasOwnProperty.call(outputs, stepName)) throw new Error(`$bind refers to unknown step "${stepName}"`); + let value = outputs[stepName]; + for (const segment of segments) { + if (value === null || typeof value !== "object" || !(segment in value)) throw new Error(`$bind path "${reference}" does not resolve`); + value = value[segment]; + } + return value; +} + +export function resolveBindings(value, outputs) { + if (Array.isArray(value)) return value.map((item) => resolveBindings(item, outputs)); + if (value && typeof value === "object") { + const keys = Object.keys(value); + if (keys.length === 1 && keys[0] === "$bind") return lookupBinding(outputs, value.$bind); + return Object.fromEntries(keys.map((key) => [key, resolveBindings(value[key], outputs)])); + } + return value; +} + +function rawBytes(parts) { + return Buffer.concat(parts.map((part) => { + if (typeof part.text === "string") return Buffer.from(part.text, "utf8"); + if (typeof part.base64 === "string") return Buffer.from(part.base64, "base64"); + if (typeof part.repeat === "string" && Number.isInteger(part.count)) return Buffer.from(part.repeat.repeat(part.count), "utf8"); + throw new Error(`unsupported raw part ${JSON.stringify(part)}`); + })); +} + +function isSubset(expected, actual) { + if (expected === null || typeof expected !== "object") return Object.is(expected, actual); + if (actual === null || typeof actual !== "object") return false; + if (Array.isArray(expected)) return Array.isArray(actual) && expected.length === actual.length && expected.every((item, index) => isSubset(item, actual[index])); + return Object.keys(expected).every((key) => isSubset(expected[key], actual[key])); +} + +// The intent of a step, checked on every run. The golden hash pins the exact +// answer; these annotations make sure a re-baseline cannot quietly accept an +// answer that contradicts what the case is for. +function checkExpectation(expectation, response) { + if (!expectation) return []; + const problems = []; + const content = response?.result?.structuredContent; + if (expectation.ok && (!response?.result || response.result.isError === true)) problems.push(`expected success, got ${JSON.stringify(response?.error ?? content).slice(0, 200)}`); + if (expectation.toolError && (response?.result?.isError !== true || content?.code !== expectation.toolError)) problems.push(`expected tool error ${expectation.toolError}, got ${JSON.stringify(response?.error ?? content).slice(0, 200)}`); + if (expectation.protocolError && !response?.error) problems.push(`expected a JSON-RPC protocol error, got ${JSON.stringify(response).slice(0, 200)}`); + if (expectation.errorMessage && response?.error?.message !== expectation.errorMessage) problems.push(`expected protocol error "${expectation.errorMessage}", got "${response?.error?.message}"`); + if (expectation.match && !isSubset(expectation.match, content)) problems.push(`structuredContent does not match ${JSON.stringify(expectation.match)}`); + if (expectation.rows && canonicalJsonString(expectation.rows) !== canonicalJsonString(response)) problems.push(`store rows ${JSON.stringify(response)} do not equal ${JSON.stringify(expectation.rows)}`); + return problems; +} + +function withStore(dbPath, options, fn) { + const db = new Database(dbPath, { fileMustExist: true, ...options }); + try { + return fn(db); + } finally { + db.close(); + } +} + +function probeStore(dbPath, sql, params) { + try { + return withStore(dbPath, { readonly: true }, (db) => db.prepare(sql).get(...params)); + } catch { + return undefined; // the store or table does not exist yet + } +} + +async function waitForCommit(dbPath, until, label) { + return withTimeout((async () => { + for (;;) { + const row = probeStore(dbPath, until.sql, until.params ?? []); + if (row) return row; + await new Promise((resolve) => setTimeout(resolve, 20)); + } + })(), label); +} + +/** Replays one case fixture against a fresh store. */ +export async function runCase(root, fixture) { + const dir = mkdtempSync(path.join(tmpdir(), "gks-c0-corpus-")); + const dbPath = path.join(dir, "gks.sqlite"); + const transcript = []; + const problems = []; + const outputs = {}; + const processes = []; + let server = null; + const ensureServer = () => { + if (!server) { + server = startServer(root, dbPath, fixture.env ?? {}); + processes.push(server); + } + return server; + }; + try { + for (const [index, step] of fixture.steps.entries()) { + const label = `step ${index + 1}${step.name ? ` (${step.name})` : ""}`; + const entry = { step: index + 1, kind: step.kind, ...(step.name ? { name: step.name } : {}) }; + if (step.kind === "call") { + const frame = resolveBindings(step.frame, outputs); + const running = ensureServer(); + running.child.stdin.write(`${JSON.stringify(frame)}\n`); + const response = await nextFrame(running, (candidate) => candidate.id === frame.id, label); + entry.response = response; + if (step.name) outputs[step.name] = response; + problems.push(...checkExpectation(step.expect, response).map((problem) => `${label}: ${problem}`)); + } else if (step.kind === "raw") { + const running = ensureServer(); + running.child.stdin.write(rawBytes(step.parts)); + const response = await nextFrame(running, () => true, label); + entry.response = response; + if (step.name) outputs[step.name] = response; + problems.push(...checkExpectation(step.expect, response).map((problem) => `${label}: ${problem}`)); + } else if (step.kind === "restart") { + if (server) await stopServer(server); + server = null; + ensureServer(); + } else if (step.kind === "kill-after-commit") { + const frame = resolveBindings(step.frame, outputs); + const running = ensureServer(); + running.child.stdin.write(`${JSON.stringify(frame)}\n`); + entry.committed = await waitForCommit(dbPath, step.until, label); + await stopServer(running, { kill: true }); + server = null; + } else if (step.kind === "store-exec") { + withStore(dbPath, {}, (db) => db.exec(step.sql)); + } else if (step.kind === "store-query") { + const rows = withStore(dbPath, { readonly: true }, (db) => db.prepare(step.sql).all(...(step.params ?? []))); + entry.rows = rows; + problems.push(...checkExpectation(step.expect, rows).map((problem) => `${label}: ${problem}`)); + } else { + throw new Error(`${label}: unknown step kind "${step.kind}"`); + } + transcript.push(entry); + } + } catch (error) { + problems.push(error.message); + } finally { + if (server) await stopServer(server); + for (const finished of processes) problems.push(...finished.violations); + // No fixture secret may reach process output or the store files. + const surfaces = processes.flatMap((finished) => [finished.stdout, finished.stderr]); + for (const file of [dbPath, `${dbPath}-wal`, `${dbPath}-shm`]) if (existsSync(file)) surfaces.push(readFileSync(file).toString("latin1")); + for (const secret of fixture.secrets ?? []) { + if (surfaces.some((surface) => surface.includes(secret))) problems.push(`fixture secret "${secret.slice(0, 6)}..." leaked to process output or the store`); + } + rmSync(dir, { recursive: true, force: true, maxRetries: 5 }); + } + return { id: fixture.id, transcript: normalizeTranscript(transcript, fixture), problems }; +} + +function collectStrings(value, into) { + if (typeof value === "string") into.add(value); + else if (value && typeof value === "object") for (const item of Object.values(value)) collectStrings(item, into); + return into; +} + +// JSON carried as a string (a tool result's text content, a stored JSON +// column) is parsed so its volatile fields are normalized like any other. A +// text block that repeats structuredContent collapses to a marker. +function expandJson(value) { + if (typeof value === "string" && /^[[{]/.test(value)) { + try { + return { $json: expandJson(JSON.parse(value)) }; + } catch { + return value; + } + } + if (Array.isArray(value)) return value.map(expandJson); + if (value && typeof value === "object") { + const expanded = Object.fromEntries(Object.entries(value).map(([key, item]) => [key, expandJson(item)])); + if (Array.isArray(value.content) && value.structuredContent !== undefined) { + const structured = canonicalJsonString(value.structuredContent); + expanded.content = value.content.map((block, index) => { + if (block?.type !== "text" || typeof block.text !== "string") return expanded.content[index]; + try { + if (canonicalJsonString(JSON.parse(block.text)) === structured) return { type: "text", text: "" }; + } catch { /* not JSON: keep the expanded form */ } + return expanded.content[index]; + }); + } + return expanded; + } + return value; +} + +function visitSorted(value, visit, key = null) { + visit(key, value); + if (Array.isArray(value)) for (const item of value) visitSorted(item, visit, key); + else if (value && typeof value === "object") for (const childKey of Object.keys(value).sort()) visitSorted(value[childKey], visit, childKey); +} + +/** Replaces run-to-run values with stable labels; see the header comment. */ +export function normalizeTranscript(transcript, fixture) { + const requestStrings = collectStrings(fixture, new Set()); + const expanded = expandJson(transcript); + const labels = new Map(); + const counters = new Map(); + visitSorted(expanded, (key, value) => { + if (typeof value !== "string" || !VOLATILE_HASH_KEYS.has(key) || labels.has(value)) return; + const name = VOLATILE_HASH_KEYS.get(key); + counters.set(name, (counters.get(name) ?? 0) + 1); + labels.set(value, `<${name}:${counters.get(name)}>`); + }); + const rewrite = (value, key) => { + if (typeof value === "string") { + if (labels.has(value)) return labels.get(value); + // A server-clock instant; an instant the caller sent is echoed verbatim. + if (ISO_INSTANT.test(value) && !requestStrings.has(value)) return ""; + let text = value; + for (const [volatile, label] of labels) if (text.includes(volatile)) text = text.split(volatile).join(label); + return text; + } + if (typeof value === "number" && DURATION_KEYS.has(key)) return ""; + if (Array.isArray(value)) return value.map((item) => rewrite(item, key)); + if (value && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([childKey, item]) => [childKey, rewrite(item, childKey)])); + return value; + }; + return rewrite(expanded, null); +} + +/** First path at which two JSON values differ, for a readable failure. */ +export function firstDifference(expected, actual, at = "$") { + // A field present on one side only is `undefined` on the other, which has + // no canonical JSON form. + if (expected === undefined || actual === undefined) return expected === actual ? null : `${at}: expected ${JSON.stringify(expected)?.slice(0, 160) ?? "nothing"} got ${JSON.stringify(actual)?.slice(0, 160) ?? "nothing"}`; + if (canonicalJsonString(expected) === canonicalJsonString(actual)) return null; + if (expected && actual && typeof expected === "object" && typeof actual === "object" && Array.isArray(expected) === Array.isArray(actual)) { + for (const key of new Set([...Object.keys(expected), ...Object.keys(actual)])) { + const difference = firstDifference(expected[key], actual[key], `${at}.${key}`); + if (difference) return difference; + } + } + return `${at}: expected ${JSON.stringify(expected)?.slice(0, 160)} got ${JSON.stringify(actual)?.slice(0, 160)}`; +} diff --git a/scripts/check-c0-qualification.mjs b/scripts/check-c0-qualification.mjs index db96bb3..1c0e805 100644 --- a/scripts/check-c0-qualification.mjs +++ b/scripts/check-c0-qualification.mjs @@ -1,9 +1,14 @@ -import { readFileSync } from "node:fs"; +// Static C0.4 qualification check: the result manifest covers the registry +// exactly, statuses and summary agree, and every runnable case's request +// fixture and golden transcript still hash to the registry. Replaying the +// corpus is `npm run check:corpus`. +import { existsSync } from "node:fs"; import path from "node:path"; +import { CORPUS_DIR, readJson, sha256Canonical } from "./c0-corpus/runner.mjs"; const root = process.cwd(); -const registry = JSON.parse(readFileSync(path.join(root, "tests/fixtures/c0-qualification/registry.json"), "utf8")); -const manifest = JSON.parse(readFileSync(path.join(root, "tests/fixtures/c0-qualification/result-manifest.json"), "utf8")); +const registry = readJson(root, `${CORPUS_DIR}/registry.json`); +const manifest = readJson(root, `${CORPUS_DIR}/result-manifest.json`); const statuses = new Set(registry.statusVocabulary); const registryIds = new Set(registry.cases.map((item) => item.id)); const manifestIds = new Set(manifest.cases.map((item) => item.id)); @@ -15,12 +20,22 @@ for (const id of registryIds) { if (!manifestIds.has(id)) throw new Error(`C0 result manifest is missing ${id}.`); } +for (const item of registry.cases) { + if (!item.runnable) continue; + for (const [file, hash, label] of [[item.fixture, item.requestSha256, "request fixture"], [item.expectedResult, item.expectedResultSha256, "golden transcript"]]) { + if (!file || !existsSync(path.join(root, CORPUS_DIR, file))) throw new Error(`C0 ${label} for ${item.id} is missing.`); + if (sha256Canonical(readJson(root, `${CORPUS_DIR}/${file}`)) !== hash) throw new Error(`C0 ${label} ${file} does not hash to the registry for ${item.id}.`); + } +} + const counts = Object.fromEntries([...statuses].map((status) => [status, 0])); for (const item of manifest.cases) { if (!statuses.has(item.status)) throw new Error(`Unsupported C0 status for ${item.id}: ${item.status}`); if (!Array.isArray(item.evidence)) throw new Error(`C0 evidence must be an array for ${item.id}.`); if (item.status === "PASS" && item.evidence.length === 0) throw new Error(`C0 PASS case has no evidence for ${item.id}.`); if (item.status !== "PASS" && typeof item.reason !== "string") throw new Error(`C0 non-PASS case has no reason for ${item.id}.`); + // A PASS is a replayable claim: only a runnable case can carry one. + if (item.status === "PASS" && !registry.cases.find((candidate) => candidate.id === item.id).runnable) throw new Error(`C0 case ${item.id} is PASS but has no replayable fixture.`); counts[item.status] += 1; } diff --git a/scripts/run-c0-corpus.mjs b/scripts/run-c0-corpus.mjs new file mode 100644 index 0000000..84eed62 --- /dev/null +++ b/scripts/run-c0-corpus.mjs @@ -0,0 +1,119 @@ +// @req GKS-MIG-002, ADR-GKS-C0-QUALIFICATION D4 — replay the C0.4 golden corpus. +// +// node scripts/run-c0-corpus.mjs replay every runnable case; exit 1 on any mismatch +// node scripts/run-c0-corpus.mjs --case ID replay one case +// node scripts/run-c0-corpus.mjs --write re-baseline: expected transcripts, registry hashes, +// result manifest +// +// A replay passes only when the request fixture still hashes to the registry, +// every step's intent annotation holds, no fixture secret leaks, stdout carries +// protocol frames only, and the normalized transcript hashes to the registry. +// --write refuses to record a case whose two consecutive runs disagree, so a +// value the normalizer misses cannot be baselined as golden. +import { execFileSync } from "node:child_process"; +import { mkdirSync, writeFileSync } from "node:fs"; +import path from "node:path"; +import { CORPUS_DIR, firstDifference, readJson, runCase, sha256Canonical } from "./c0-corpus/runner.mjs"; + +const root = process.cwd(); +const REGISTRY = `${CORPUS_DIR}/registry.json`; +const MANIFEST = `${CORPUS_DIR}/result-manifest.json`; +const args = process.argv.slice(2); +const write = args.includes("--write"); +const only = args.includes("--case") ? args[args.indexOf("--case") + 1] : null; +if (write && only) throw new Error("--write re-baselines the whole corpus; it cannot be combined with --case."); + +function writeJson(relativePath, value) { + const file = path.join(root, relativePath); + mkdirSync(path.dirname(file), { recursive: true }); + writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`); +} + +function provenance() { + const git = (...gitArgs) => execFileSync("git", gitArgs, { cwd: root, encoding: "utf8" }).trim(); + const head = git("rev-parse", "HEAD"); + const dirty = git("status", "--porcelain", "--", "apps", "packages", "migrations", CORPUS_DIR, "scripts/c0-corpus", "scripts/run-c0-corpus.mjs") !== ""; + return dirty ? `${head}+working-tree` : head; +} + +const registry = readJson(root, REGISTRY); +const manifest = readJson(root, MANIFEST); +const selected = registry.cases.filter((item) => item.runnable && (!only || item.id === only)); +if (only && !selected.length) throw new Error(`No runnable case ${only} in the registry.`); + +const failures = []; +const results = new Map(); +for (const item of selected) { + const fixture = readJson(root, `${CORPUS_DIR}/${item.fixture}`); + const problems = []; + if (sha256Canonical(fixture) !== item.requestSha256) problems.push(`request fixture ${item.fixture} does not hash to the registry; rebuild with scripts/c0-corpus/build-cases.mjs`); + const run = await runCase(root, fixture); + problems.push(...run.problems); + const actualSha256 = sha256Canonical(run.transcript); + if (write) { + if (!problems.length) { + const again = await runCase(root, fixture); + if (sha256Canonical(again.transcript) !== actualSha256) problems.push(`not deterministic across two runs: ${firstDifference(run.transcript, again.transcript)}`); + problems.push(...again.problems); + } + if (!problems.length) { + writeJson(`${CORPUS_DIR}/${item.expectedResult}`, run.transcript); + item.expectedResultSha256 = actualSha256; + } + } else if (actualSha256 !== item.expectedResultSha256) { + let expected = null; + try { + expected = readJson(root, `${CORPUS_DIR}/${item.expectedResult}`); + } catch { /* reported below */ } + if (!expected) problems.push(`expected transcript ${item.expectedResult} is missing`); + else if (sha256Canonical(expected) !== item.expectedResultSha256) problems.push(`expected transcript ${item.expectedResult} does not hash to the registry`); + else problems.push(`transcript differs from the golden result at ${firstDifference(expected, run.transcript)}`); + } + const manifestCase = manifest.cases?.find((candidate) => candidate.id === item.id); + if (!write && manifestCase?.status !== "PASS") problems.push(`result manifest records ${manifestCase?.status ?? "no status"}, not PASS`); + results.set(item.id, problems); + console.log(`${problems.length ? "FAIL" : "PASS"} ${item.id} (${fixture.steps.length} steps)`); + for (const problem of problems) console.log(` - ${problem}`); + if (problems.length) failures.push(item.id); +} + +if (write) { + if (failures.length) { + console.error(`Not re-baselined: ${failures.length} case(s) failed. Fix them first.`); + process.exit(1); + } + writeJson(REGISTRY, registry); + const status = (item) => (item.runnable ? (item.expectedResultSha256 ? "PASS" : "NOT_RUN") : "NOT_RUN"); + const cases = registry.cases.map((item) => { + const evidence = item.runnable ? [`${CORPUS_DIR}/${item.fixture}`, `${CORPUS_DIR}/${item.expectedResult}`, ...item.evidence.testPaths] : item.evidence.testPaths; + return status(item) === "PASS" ? { id: item.id, status: "PASS", evidence } : { id: item.id, status: status(item), evidence, reason: item.evidence.reason }; + }); + const summary = { PASS: 0, FAIL: 0, NOT_RUN: 0, BLOCKED: 0 }; + for (const item of cases) summary[item.status] += 1; + writeJson(MANIFEST, { + resultVersion: "c0-qualification-result/v2", + registryVersion: registry.registryVersion, + fixtureId: registry.fixtureId, + recordedAt: new Date().toISOString().slice(0, 10), + recordedFrom: provenance(), + runtime: { node: process.versions.node, platform: process.platform, database: "repository-owned SQLite", secretsIncluded: false }, + runs: [{ id: "c0-corpus", status: "PASS", command: "npm run check:corpus", cases: selected.length, evidence: "Every runnable case replayed against a real gks-server stdio process on a fresh store, twice, with identical normalized transcripts." }], + // Real-MSP runs cannot be replayed from this repository; they are carried + // forward with their own recording date, never re-dated by a re-baseline. + externalRuns: manifest.externalRuns ?? (manifest.runs ?? []).filter((run) => run.id.startsWith("msp-")).map((run) => ({ ...run, recordedAt: run.recordedAt ?? manifest.recordedAt, baselineSha: run.baselineSha ?? manifest.baselineSha })), + cases, + summary, + gate: { + status: summary.NOT_RUN || summary.BLOCKED ? "PASS_WITH_LIMITATIONS" : "PASS", + meaning: "Every runnable C0.4 case replays from its tracked request fixture to its golden transcript. Tier-4 physical readback is outside the GKS boundary and stays NOT_RUN; deployment is not authorized by this gate.", + productionReady: false, + deploymentAuthorized: false, + }, + }); + console.log(`Re-baselined ${selected.length} case(s); registry and result manifest written.`); +} else if (failures.length) { + console.error(`C0.4 corpus: ${failures.length} of ${selected.length} case(s) failed.`); + process.exit(1); +} else { + console.log(`C0.4 corpus: all ${selected.length} runnable case(s) replay to their golden results.`); +} diff --git a/tests/contract/c0-golden-registry.test.mjs b/tests/contract/c0-golden-registry.test.mjs index d9c22ab..09cfd27 100644 --- a/tests/contract/c0-golden-registry.test.mjs +++ b/tests/contract/c0-golden-registry.test.mjs @@ -1,11 +1,18 @@ +// The C0.4 golden corpus (registry c0-qualification/v2) as a tracked artifact: +// its shape, its coverage of the public tools, the integrity of every request +// fixture and golden transcript, and that the fixtures are exactly what the +// builder produces. Replaying the corpus is tests/integration/c0-corpus.test.mjs. import { describe, expect, it } from "vitest"; import { readFileSync } from "node:fs"; import path from "node:path"; -import { GKS_TOOL_DEFINITIONS } from "@freshair129/gks-contracts"; +import { GKS_TOOL_DEFINITIONS, canonicalJsonString } from "@freshair129/gks-contracts"; +import { buildCorpus } from "../../scripts/c0-corpus/build-cases.mjs"; +import { sha256Canonical } from "../../scripts/c0-corpus/runner.mjs"; -const registryPath = path.resolve(process.cwd(), "tests/fixtures/c0-qualification/registry.json"); -const registry = JSON.parse(readFileSync(registryPath, "utf8")); -const resultManifest = JSON.parse(readFileSync(path.resolve(process.cwd(), "tests/fixtures/c0-qualification/result-manifest.json"), "utf8")); +const CORPUS = path.resolve(process.cwd(), "tests/fixtures/c0-qualification"); +const readJson = (relativePath) => JSON.parse(readFileSync(path.join(CORPUS, relativePath), "utf8")); +const registry = readJson("registry.json"); +const resultManifest = readJson("result-manifest.json"); const SHA256 = /^[a-f0-9]{64}$/; const STATUS_VOCABULARY = ["PASS", "FAIL", "NOT_RUN", "BLOCKED"]; const REQUIRED_CATEGORIES = [ @@ -18,11 +25,13 @@ const REQUIRED_CATEGORIES = [ "backend-failure", "lost-response-replay", ]; +const runnable = registry.cases.filter((item) => item.runnable); describe("C0.4 golden qualification registry", () => { it("has the deterministic registry and case shape", () => { expect(registry).toMatchObject({ - registryVersion: "c0-qualification/v1", + registryVersion: "c0-qualification/v2", + supersedes: "c0-qualification/v1", fixtureId: "gks-c0.4-golden", profile: "C0.4", statusVocabulary: STATUS_VOCABULARY, @@ -30,49 +39,30 @@ describe("C0.4 golden qualification registry", () => { provenance: { adr: "docs/ADR-GKS-C0-QUALIFICATION.md", toolDefinitions: "packages/gks-contracts/src/tool-definitions.mjs", - runtime: "fixture-only", + builder: "scripts/c0-corpus/build-cases.mjs", + runner: "scripts/run-c0-corpus.mjs", containsSecrets: false, externalEndpoints: false, }, }); - expect(Array.isArray(registry.cases)).toBe(true); - expect(registry.cases.length).toBeGreaterThanOrEqual(24); - + expect(registry.cases.length).toBeGreaterThanOrEqual(25); for (const qualificationCase of registry.cases) { expect(qualificationCase).toMatchObject({ id: expect.any(String), fixtureId: registry.fixtureId, contractVersion: registry.registryVersion, category: expect.any(String), - status: expect.stringMatching(/^(PASS|FAIL|NOT_RUN|BLOCKED)$/), - requestSha256: expect.stringMatching(SHA256), - expectedResultSha256: expect.stringMatching(SHA256), - normalizedScope: { - portfolioId: expect.any(String), - tenantId: expect.any(String), - businessId: expect.any(String), - workspaceId: expect.any(String), - agentId: expect.any(String), - visibility: expect.any(String), - }, - expected: { - opaqueRefs: expect.any(Array), - receiptHashes: expect.any(Array), - cursorOutcome: expect.any(String), - }, - evidence: { - executable: expect.any(Boolean), - testPaths: expect.any(Array), - reason: expect.any(String), - }, + runnable: expect.any(Boolean), + normalizedScope: expect.objectContaining({ portfolioId: expect.any(String), tenantId: expect.any(String) }), + expected: { opaqueRefs: expect.any(Array), receiptHashes: expect.any(Array), cursorOutcome: expect.any(String) }, + evidence: { testPaths: expect.any(Array), reason: expect.any(String) }, }); - expect(STATUS_VOCABULARY).toContain(qualificationCase.status); expect(qualificationCase.expected).toHaveProperty("ledger"); expect(qualificationCase.expected).toHaveProperty("errorCode"); - - if (qualificationCase.status === "PASS") { - expect(qualificationCase.evidence.executable).toBe(true); - expect(qualificationCase.evidence.testPaths.length).toBeGreaterThan(0); + if (qualificationCase.runnable) { + expect(qualificationCase).toMatchObject({ fixture: `cases/${qualificationCase.id}.json`, expectedResult: `expected/${qualificationCase.id}.json`, requestSha256: expect.stringMatching(SHA256), expectedResultSha256: expect.stringMatching(SHA256) }); + } else { + expect(qualificationCase).toMatchObject({ fixture: null, expectedResult: null, requestSha256: null, expectedResultSha256: null }); } } }); @@ -82,32 +72,54 @@ describe("C0.4 golden qualification registry", () => { expect(new Set(ids).size).toBe(ids.length); }); - it("contains the minimum approved C0.4 categories", () => { + it("contains the minimum approved C0.4 categories, each with a replayable case", () => { expect(new Set(registry.cases.map((qualificationCase) => qualificationCase.category))).toEqual(new Set(REQUIRED_CATEGORIES)); for (const category of REQUIRED_CATEGORIES) { - expect(registry.cases.filter((qualificationCase) => qualificationCase.category === category).length).toBeGreaterThan(0); + expect(runnable.filter((qualificationCase) => qualificationCase.category === category).length, category).toBeGreaterThan(0); } }); - it("covers exactly the 17 registered GKS tools", () => { + it("covers exactly the 17 registered GKS tools, and each tool case calls its tool", () => { expect(GKS_TOOL_DEFINITIONS).toHaveLength(17); const toolCases = registry.cases.filter((qualificationCase) => qualificationCase.category === "tool"); - expect(toolCases).toHaveLength(17); expect(toolCases.map((qualificationCase) => qualificationCase.tool)).toEqual(GKS_TOOL_DEFINITIONS.map((tool) => tool.name)); - expect(new Set(toolCases.map((qualificationCase) => qualificationCase.tool)).size).toBe(17); + for (const toolCase of toolCases) { + expect(toolCase.runnable).toBe(true); + const calledTools = readJson(toolCase.fixture).steps.filter((step) => step.kind === "call").map((step) => step.frame.params?.name); + expect(calledTools, toolCase.id).toContain(toolCase.tool); + } + }); + + it("pins every request fixture and golden transcript by hash", () => { + for (const qualificationCase of runnable) { + expect(sha256Canonical(readJson(qualificationCase.fixture)), qualificationCase.fixture).toBe(qualificationCase.requestSha256); + expect(sha256Canonical(readJson(qualificationCase.expectedResult)), qualificationCase.expectedResult).toBe(qualificationCase.expectedResultSha256); + } + }); + + it("rebuilds to exactly the committed fixtures", async () => { + const { registry: rebuilt, fixtures } = await buildCorpus(); + for (const qualificationCase of runnable) { + expect(canonicalJsonString(fixtures[qualificationCase.id]), `${qualificationCase.id} drifted from scripts/c0-corpus/build-cases.mjs`).toBe(canonicalJsonString(readJson(qualificationCase.fixture))); + } + const withoutResultHashes = (cases) => cases.map(({ expectedResultSha256: _hash, ...rest }) => rest); + expect(canonicalJsonString(withoutResultHashes(rebuilt.cases))).toBe(canonicalJsonString(withoutResultHashes(registry.cases))); }); it("has a complete closeout manifest with explicit limitations", () => { expect(resultManifest).toMatchObject({ - resultVersion: "c0-qualification-result/v1", + resultVersion: "c0-qualification-result/v2", registryVersion: registry.registryVersion, fixtureId: registry.fixtureId, - summary: { PASS: 23, FAIL: 0, NOT_RUN: 1, BLOCKED: 0 }, + summary: { PASS: 24, FAIL: 0, NOT_RUN: 1, BLOCKED: 0 }, gate: { status: "PASS_WITH_LIMITATIONS", productionReady: false, deploymentAuthorized: false }, }); - expect(resultManifest.cases).toHaveLength(registry.cases.length); - expect(resultManifest.cases.filter((item) => item.status === "PASS")).toHaveLength(23); - expect(resultManifest.cases.filter((item) => item.status === "NOT_RUN")).toHaveLength(1); - expect(resultManifest.cases.every((item) => registry.cases.some((candidate) => candidate.id === item.id))).toBe(true); + expect(resultManifest.cases.map((item) => item.id)).toEqual(registry.cases.map((item) => item.id)); + for (const item of resultManifest.cases) { + const registered = registry.cases.find((candidate) => candidate.id === item.id); + // PASS is a replayable claim; the one NOT_RUN case is the Tier-4 readback. + expect(item.status, item.id).toBe(registered.runnable ? "PASS" : "NOT_RUN"); + } + expect(resultManifest.cases.find((item) => item.status === "NOT_RUN")).toMatchObject({ id: "C0.4-TIER4-READBACK", reason: expect.stringContaining("GenesisBlockDB") }); }); }); diff --git a/tests/fixtures/baseline-lock.json b/tests/fixtures/baseline-lock.json index 4537646..936e7fc 100644 --- a/tests/fixtures/baseline-lock.json +++ b/tests/fixtures/baseline-lock.json @@ -1,10 +1,10 @@ { "lockVersion": "gks-baseline-lock/v1", "lockedAt": "2026-09-27", - "lockedFromCommit": "bb00cef8ab5bd70d4013c9904ec0061026c9d413+working-tree", + "lockedFromCommit": "f50116abdc3fe606851df4d21697027e252341c7+working-tree", "nodeEngine": ">=22", "packageLockSha256": "fd757eacd72880fe7b3a496715f764ca82f0dfa6dcc3b32bdb163d6faf4c4e9c", - "workflowSha256": "fd971d0de6262862c8a85bce552bd034a8cd66b60fba7f8e4544378d328d8feb", + "workflowSha256": "c15b8c35bff3baf2d643f0e309cc74a209baf5985d78944386510aadb7ec8eb3", "migrations": [ { "name": "0001_init.sql", diff --git a/tests/fixtures/c0-qualification/cases/C0.4-API010-REPLAY.json b/tests/fixtures/c0-qualification/cases/C0.4-API010-REPLAY.json new file mode 100644 index 0000000..ecdf4b2 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-API010-REPLAY.json @@ -0,0 +1,210 @@ +{ + "id": "C0.4-API010-REPLAY", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-api010", + "run_id": "c0-api010-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-api010", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true, + "match": { + "idempotent": false + } + } + }, + { + "kind": "restart" + }, + { + "kind": "call", + "name": "replay", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-api010", + "run_id": "c0-api010-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-api010", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true, + "match": { + "idempotent": true + } + } + }, + { + "kind": "call", + "name": "conflict", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-api010", + "run_id": "c0-api010-run", + "stage": 1, + "source_snapshot_hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "provenance_ref": "msp:proof/c0-api010", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "toolError": "gks_conflict" + } + }, + { + "kind": "store-query", + "sql": "SELECT COUNT(*) AS promotions FROM promotions WHERE idempotency_key = ?", + "params": [ + "c0-api010" + ], + "expect": { + "rows": [ + { + "promotions": 1 + } + ] + } + }, + { + "kind": "store-query", + "sql": "SELECT COUNT(*) AS evidence FROM stage_evidence", + "params": [], + "expect": { + "rows": [ + { + "evidence": 1 + } + ] + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-AUTH-DENIAL.json b/tests/fixtures/c0-qualification/cases/C0.4-AUTH-DENIAL.json new file mode 100644 index 0000000..61785b9 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-AUTH-DENIAL.json @@ -0,0 +1,441 @@ +{ + "id": "C0.4-AUTH-DENIAL", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay", + "GKS_MSP_AUTH_REQUIRED": "1", + "GKS_MSP_RELAY_CREDENTIAL": "c0-fixture-msp-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay", + "c0-fixture-msp-relay" + ], + "steps": [ + { + "kind": "call", + "name": "health", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_health", + "arguments": {} + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "missing", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-auth", + "run_id": "c0-auth-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-auth", + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "call", + "name": "forgedCredential", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-auth", + "run_id": "c0-auth-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-auth", + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + }, + "_meta": { + "gksMspAuth": { + "version": "gks-msp-auth/v1", + "principalId": "msp-runtime", + "role": "msp", + "relayCredential": "c0-fixture-msp-relay-forged", + "scopeDigest": "b8596588cdb491afd11b1a1bbd463e8d71797ecb5feb1df742b07b5df940a9d3" + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "call", + "name": "wrongRole", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-auth", + "run_id": "c0-auth-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-auth", + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + }, + "_meta": { + "gksMspAuth": { + "version": "gks-msp-auth/v1", + "principalId": "msp-runtime", + "role": "worker", + "relayCredential": "c0-fixture-msp-relay", + "scopeDigest": "b8596588cdb491afd11b1a1bbd463e8d71797ecb5feb1df742b07b5df940a9d3" + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "call", + "name": "staleVersion", + "frame": { + "jsonrpc": "2.0", + "id": 5, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-auth", + "run_id": "c0-auth-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-auth", + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + }, + "_meta": { + "gksMspAuth": { + "version": "gks-msp-auth/v0", + "principalId": "msp-runtime", + "role": "msp", + "relayCredential": "c0-fixture-msp-relay", + "scopeDigest": "b8596588cdb491afd11b1a1bbd463e8d71797ecb5feb1df742b07b5df940a9d3" + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "call", + "name": "forgedScope", + "frame": { + "jsonrpc": "2.0", + "id": 6, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-auth", + "run_id": "c0-auth-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-auth", + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + }, + "_meta": { + "gksMspAuth": { + "version": "gks-msp-auth/v1", + "principalId": "msp-runtime", + "role": "msp", + "relayCredential": "c0-fixture-msp-relay", + "scopeDigest": "5787d3892e12c14e76aaa169590eb3156b26cc9dd597d0c015fdf6068dfe6c7e" + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "call", + "name": "searchUnauthenticated", + "frame": { + "jsonrpc": "2.0", + "id": 7, + "method": "tools/call", + "params": { + "name": "gks_search", + "arguments": { + "query": "LINE", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "store-query", + "sql": "SELECT COUNT(*) AS promotions FROM promotions", + "params": [], + "expect": { + "rows": [ + { + "promotions": 0 + } + ] + } + }, + { + "kind": "call", + "name": "accepted", + "frame": { + "jsonrpc": "2.0", + "id": 8, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-auth", + "run_id": "c0-auth-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-auth", + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + }, + "_meta": { + "gksMspAuth": { + "version": "gks-msp-auth/v1", + "principalId": "msp-runtime", + "role": "msp", + "relayCredential": "c0-fixture-msp-relay", + "scopeDigest": "b8596588cdb491afd11b1a1bbd463e8d71797ecb5feb1df742b07b5df940a9d3" + } + } + } + }, + "expect": { + "ok": true, + "match": { + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "search", + "frame": { + "jsonrpc": "2.0", + "id": 9, + "method": "tools/call", + "params": { + "name": "gks_search", + "arguments": { + "query": "LINE", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + }, + "_meta": { + "gksMspAuth": { + "version": "gks-msp-auth/v1", + "principalId": "msp-runtime", + "role": "msp", + "relayCredential": "c0-fixture-msp-relay", + "scopeDigest": "b8596588cdb491afd11b1a1bbd463e8d71797ecb5feb1df742b07b5df940a9d3" + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "store-query", + "sql": "SELECT COUNT(*) AS promotions FROM promotions", + "params": [], + "expect": { + "rows": [ + { + "promotions": 1 + } + ] + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-BACKEND-FAILURE.json b/tests/fixtures/c0-qualification/cases/C0.4-BACKEND-FAILURE.json new file mode 100644 index 0000000..01365e8 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-BACKEND-FAILURE.json @@ -0,0 +1,156 @@ +{ + "id": "C0.4-BACKEND-FAILURE", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-backend", + "run_id": "c0-backend-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-backend", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "store-exec", + "sql": "DROP TABLE stage_evidence" + }, + { + "kind": "call", + "name": "failed", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-backend-2", + "run_id": "c0-backend-2-run", + "stage": 1, + "source_snapshot_hash": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "provenance_ref": "msp:proof/c0-backend-2", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "C0-BACKEND-PROBE", + "type": "ENTITY", + "title": "Backend probe" + } + ], + "relations": [] + } + } + } + }, + "expect": { + "toolError": "gks_backend_unavailable" + } + }, + { + "kind": "store-query", + "sql": "SELECT COUNT(*) AS entities FROM entities WHERE candidate_ref = ?", + "params": [ + "C0-BACKEND-PROBE" + ], + "expect": { + "rows": [ + { + "entities": 0 + } + ] + } + }, + { + "kind": "store-query", + "sql": "SELECT COUNT(*) AS promotions FROM promotions WHERE idempotency_key = ?", + "params": [ + "c0-backend-2" + ], + "expect": { + "rows": [ + { + "promotions": 0 + } + ] + } + }, + { + "kind": "call", + "name": "alive", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_health", + "arguments": {} + } + }, + "expect": { + "ok": true + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-GENESISRAG17-RECEIPTS.json b/tests/fixtures/c0-qualification/cases/C0.4-GENESISRAG17-RECEIPTS.json new file mode 100644 index 0000000..9ba81e4 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-GENESISRAG17-RECEIPTS.json @@ -0,0 +1,2115 @@ +{ + "id": "C0.4-GENESISRAG17-RECEIPTS", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "submit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-receipts", + "idempotencyKey": "c0-receipts-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-run", + "executionStepId": "c0-receipts-step-9", + "attemptId": "c0-receipts-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-run", + "executionStepId": "c0-receipts-step-10", + "attemptId": "c0-receipts-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-run", + "executionStepId": "c0-receipts-step-11", + "attemptId": "c0-receipts-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-run", + "executionStepId": "c0-receipts-step-12", + "attemptId": "c0-receipts-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-run", + "executionStepId": "c0-receipts-step-13", + "attemptId": "c0-receipts-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-run", + "executionStepId": "c0-receipts-step-14", + "attemptId": "c0-receipts-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-run", + "executionStepId": "c0-receipts-step-15", + "attemptId": "c0-receipts-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-run", + "executionStepId": "c0-receipts-step-16", + "attemptId": "c0-receipts-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-run", + "executionStepId": "c0-receipts-step-17", + "attemptId": "c0-receipts-attempt-17" + } + ], + "source": { + "sourceId": "c0-receipts-source", + "rawArtifactId": "c0-receipts-raw", + "parsedArtifactId": "c0-receipts-parsed", + "documentId": "c0-receipts-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-receipts-chunk-1", + "parsedArtifactId": "c0-receipts-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-receipts-chunk-2", + "parsedArtifactId": "c0-receipts-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-receipts-chunk-3", + "parsedArtifactId": "c0-receipts-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-receipts-chunk-4", + "parsedArtifactId": "c0-receipts-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-receipts-chunk-5", + "parsedArtifactId": "c0-receipts-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-receipts-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-receipts-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-receipts-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-receipts-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-receipts-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-receipts-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-receipts-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-receipts-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-receipts-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-receipts-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-receipts-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-receipts-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-receipts-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-receipts-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-receipts-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-receipts-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-receipts-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-receipts-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-receipts-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-receipts-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-receipts", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "claim", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_pipeline_claim", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "decisions": [ + { + "batchId": "c0-receipts", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c" + } + ] + } + } + }, + { + "kind": "call", + "name": "graph", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-receipts-attempt-9", + "executionStepId": "c0-receipts-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-attempt-10", + "executionStepId": "c0-receipts-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-attempt-11", + "executionStepId": "c0-receipts-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-attempt-12", + "executionStepId": "c0-receipts-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-receipts-attempt-13", + "executionStepId": "c0-receipts-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-attempt-14", + "executionStepId": "c0-receipts-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-attempt-15", + "executionStepId": "c0-receipts-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-attempt-16", + "executionStepId": "c0-receipts-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-attempt-17", + "executionStepId": "c0-receipts-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-receipts-graph-tx", + "frontier": "c0-receipts-graph-frontier", + "checkpoint": "c0-receipts-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "graphReplay", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-receipts-attempt-9", + "executionStepId": "c0-receipts-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-attempt-10", + "executionStepId": "c0-receipts-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-attempt-11", + "executionStepId": "c0-receipts-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-attempt-12", + "executionStepId": "c0-receipts-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-receipts-attempt-13", + "executionStepId": "c0-receipts-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-attempt-14", + "executionStepId": "c0-receipts-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-attempt-15", + "executionStepId": "c0-receipts-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-attempt-16", + "executionStepId": "c0-receipts-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-attempt-17", + "executionStepId": "c0-receipts-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-receipts-graph-tx", + "frontier": "c0-receipts-graph-frontier", + "checkpoint": "c0-receipts-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "idempotent": true + } + } + }, + { + "kind": "call", + "name": "wrongHash", + "frame": { + "jsonrpc": "2.0", + "id": 5, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": "0000000000000000000000000000000000000000000000000000000000000000", + "stages": [ + { + "attemptId": "c0-receipts-attempt-9", + "executionStepId": "c0-receipts-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-attempt-10", + "executionStepId": "c0-receipts-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-attempt-11", + "executionStepId": "c0-receipts-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-attempt-12", + "executionStepId": "c0-receipts-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-receipts-attempt-13", + "executionStepId": "c0-receipts-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-attempt-14", + "executionStepId": "c0-receipts-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-attempt-15", + "executionStepId": "c0-receipts-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-attempt-16", + "executionStepId": "c0-receipts-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-attempt-17", + "executionStepId": "c0-receipts-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-receipts-graph-tx", + "frontier": "c0-receipts-graph-frontier", + "checkpoint": "c0-receipts-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "toolError": "gks_conflict" + } + }, + { + "kind": "call", + "name": "wrongScope", + "frame": { + "jsonrpc": "2.0", + "id": 6, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant-b", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-receipts-attempt-9", + "executionStepId": "c0-receipts-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-attempt-10", + "executionStepId": "c0-receipts-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-attempt-11", + "executionStepId": "c0-receipts-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-attempt-12", + "executionStepId": "c0-receipts-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-receipts-attempt-13", + "executionStepId": "c0-receipts-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-attempt-14", + "executionStepId": "c0-receipts-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-attempt-15", + "executionStepId": "c0-receipts-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-attempt-16", + "executionStepId": "c0-receipts-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-attempt-17", + "executionStepId": "c0-receipts-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-receipts-graph-tx", + "frontier": "c0-receipts-graph-frontier", + "checkpoint": "c0-receipts-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "call", + "name": "wrongStage", + "frame": { + "jsonrpc": "2.0", + "id": 7, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-receipts-attempt-9", + "executionStepId": "c0-receipts-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-attempt-10", + "executionStepId": "c0-receipts-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-attempt-11", + "executionStepId": "c0-receipts-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-attempt-12", + "executionStepId": "c0-receipts-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-forged-attempt", + "executionStepId": "c0-receipts-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-attempt-14", + "executionStepId": "c0-receipts-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-attempt-15", + "executionStepId": "c0-receipts-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-attempt-16", + "executionStepId": "c0-receipts-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-attempt-17", + "executionStepId": "c0-receipts-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-receipts-graph-tx", + "frontier": "c0-receipts-graph-frontier", + "checkpoint": "c0-receipts-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "toolError": "gks_conflict" + } + }, + { + "kind": "call", + "name": "sourceRole", + "frame": { + "jsonrpc": "2.0", + "id": 8, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-receipts-attempt-9", + "executionStepId": "c0-receipts-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-attempt-10", + "executionStepId": "c0-receipts-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-attempt-11", + "executionStepId": "c0-receipts-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-attempt-12", + "executionStepId": "c0-receipts-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-receipts-attempt-13", + "executionStepId": "c0-receipts-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-attempt-14", + "executionStepId": "c0-receipts-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-attempt-15", + "executionStepId": "c0-receipts-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-attempt-16", + "executionStepId": "c0-receipts-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-attempt-17", + "executionStepId": "c0-receipts-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-receipts-graph-tx", + "frontier": "c0-receipts-graph-frontier", + "checkpoint": "c0-receipts-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "call", + "name": "write", + "frame": { + "jsonrpc": "2.0", + "id": 9, + "method": "tools/call", + "params": { + "name": "gks_pipeline_write_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-receipts-attempt-9", + "executionStepId": "c0-receipts-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-attempt-10", + "executionStepId": "c0-receipts-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-attempt-11", + "executionStepId": "c0-receipts-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-attempt-12", + "executionStepId": "c0-receipts-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-receipts-attempt-13", + "executionStepId": "c0-receipts-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-attempt-14", + "executionStepId": "c0-receipts-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-attempt-15", + "executionStepId": "c0-receipts-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-attempt-16", + "executionStepId": "c0-receipts-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-attempt-17", + "executionStepId": "c0-receipts-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-run", + "stageNumber": 17 + } + ], + "graphReceiptHash": { + "$bind": "graph.result.structuredContent.graphReceiptHash" + }, + "derivedHash": { + "$bind": "graph.result.structuredContent.derivedHash" + }, + "executionTimes": { + "13": { + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "15": { + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z" + }, + "16": { + "startedAt": "2026-09-07T15:00:02.000Z", + "finishedAt": "2026-09-07T15:00:02.100Z" + } + }, + "snapshotId": "c0-receipts-snapshot", + "generation": "c0-receipts-generation", + "model": { + "id": "intfloat/multilingual-e5-small", + "revision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "dimensions": 384, + "metric": "cosine", + "artifactHashes": { + "model.safetensors": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + }, + "transaction": { + "id": "c0-receipts-final-tx", + "frontier": "c0-receipts-final-frontier", + "checkpoint": "c0-receipts-final-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 28, + "edgeCount": 44, + "vectorCount": 5, + "citationCount": 5 + }, + "laneManifest": { + "vector": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "lexical": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "graph": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 44 + }, + "sqlite": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 28 + }, + "bitemporal": { + "status": "not_applicable", + "reason": "frozen-fixture", + "objects": 0 + }, + "provenance": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + } + }, + "metrics": { + "13": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "15": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "16": { + "records_in": 72, + "records_out": 72, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + } + }, + "benchmark": { + "fixtureVersion": "ki17-corpus-v1", + "queryCount": 5, + "recallAt5": 1, + "mrr": 1, + "citationCorrectness": 1, + "crossTenantLeaks": 0 + } + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "gate", + "frame": { + "jsonrpc": "2.0", + "id": 10, + "method": "tools/call", + "params": { + "name": "gks_pipeline_gate", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "verdict": { + "verdict": "PASS", + "allowPublication": true + } + } + } + }, + { + "kind": "call", + "name": "publication", + "frame": { + "jsonrpc": "2.0", + "id": 11, + "method": "tools/call", + "params": { + "name": "gks_pipeline_publication_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "snapshotId": "c0-receipts-snapshot", + "generation": "c0-receipts-generation", + "receiptHash": { + "$bind": "write.result.structuredContent.receiptHash" + }, + "publishedAt": "2026-09-07T15:00:03.000Z", + "pointerHash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "modelRevision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "transactionFrontier": "c0-receipts-final-frontier", + "readback": { + "ok": true + } + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "evidence", + "frame": { + "jsonrpc": "2.0", + "id": 12, + "method": "tools/call", + "params": { + "name": "gks_pipeline_evidence", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "failed-submit", + "frame": { + "jsonrpc": "2.0", + "id": 13, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-receipts-failed", + "idempotencyKey": "c0-receipts-failed-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-9", + "attemptId": "c0-receipts-failed-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-10", + "attemptId": "c0-receipts-failed-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-11", + "attemptId": "c0-receipts-failed-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-12", + "attemptId": "c0-receipts-failed-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-13", + "attemptId": "c0-receipts-failed-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-14", + "attemptId": "c0-receipts-failed-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-15", + "attemptId": "c0-receipts-failed-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-16", + "attemptId": "c0-receipts-failed-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-17", + "attemptId": "c0-receipts-failed-attempt-17" + } + ], + "source": { + "sourceId": "c0-receipts-failed-source", + "rawArtifactId": "c0-receipts-failed-raw", + "parsedArtifactId": "c0-receipts-failed-parsed", + "documentId": "c0-receipts-failed-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-receipts-failed-chunk-1", + "parsedArtifactId": "c0-receipts-failed-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-receipts-failed-chunk-2", + "parsedArtifactId": "c0-receipts-failed-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-receipts-failed-chunk-3", + "parsedArtifactId": "c0-receipts-failed-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-receipts-failed-chunk-4", + "parsedArtifactId": "c0-receipts-failed-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-receipts-failed-chunk-5", + "parsedArtifactId": "c0-receipts-failed-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-receipts-failed-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-receipts-failed-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-receipts-failed-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-receipts-failed-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-receipts-failed-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-receipts-failed-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-receipts-failed-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-receipts-failed-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-receipts-failed-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-receipts-failed-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-receipts-failed-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-receipts-failed-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-receipts-failed-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-receipts-failed-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-receipts-failed-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-receipts-failed-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-receipts-failed-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-receipts-failed-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-receipts-failed-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-receipts-failed-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-receipts-failed", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "failed-claim", + "frame": { + "jsonrpc": "2.0", + "id": 14, + "method": "tools/call", + "params": { + "name": "gks_pipeline_claim", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "decisions": [ + { + "batchId": "c0-receipts-failed", + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d" + } + ] + } + } + }, + { + "kind": "call", + "name": "failed-graph", + "frame": { + "jsonrpc": "2.0", + "id": 15, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-receipts-failed-run", + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d", + "decisionHash": { + "$bind": "failed-claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-receipts-failed-attempt-9", + "executionStepId": "c0-receipts-failed-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-failed-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-failed-attempt-10", + "executionStepId": "c0-receipts-failed-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-failed-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-failed-attempt-11", + "executionStepId": "c0-receipts-failed-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-failed-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-failed-attempt-12", + "executionStepId": "c0-receipts-failed-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-failed-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-receipts-failed-attempt-13", + "executionStepId": "c0-receipts-failed-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-failed-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-failed-attempt-14", + "executionStepId": "c0-receipts-failed-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-failed-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-failed-attempt-15", + "executionStepId": "c0-receipts-failed-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-failed-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-failed-attempt-16", + "executionStepId": "c0-receipts-failed-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-failed-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-failed-attempt-17", + "executionStepId": "c0-receipts-failed-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-failed-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-receipts-failed-graph-tx", + "frontier": "c0-receipts-failed-graph-frontier", + "checkpoint": "c0-receipts-failed-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "failure", + "frame": { + "jsonrpc": "2.0", + "id": 16, + "method": "tools/call", + "params": { + "name": "gks_pipeline_stage_failure", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d", + "decisionHash": { + "$bind": "failed-claim.result.structuredContent.decisions.0.decisionHash" + }, + "stage": { + "attemptId": "c0-receipts-failed-attempt-15", + "executionStepId": "c0-receipts-failed-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-failed-run", + "stageNumber": 15 + }, + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z", + "metrics": { + "records_in": 1, + "records_out": 1, + "records_quarantined": 0, + "error_count": 1, + "retry_count": 0, + "duration_ms": 1 + }, + "error": { + "code": "INDEX_WRITE_FAILED", + "message": "C0 fixture index write failure" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true + } + } + }, + { + "kind": "call", + "name": "gateAfterFailure", + "frame": { + "jsonrpc": "2.0", + "id": 17, + "method": "tools/call", + "params": { + "name": "gks_pipeline_gate", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d", + "decisionHash": { + "$bind": "failed-claim.result.structuredContent.decisions.0.decisionHash" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "verdict": { + "verdict": "FAIL", + "allowPublication": false + } + } + } + }, + { + "kind": "call", + "name": "failedEvidence", + "frame": { + "jsonrpc": "2.0", + "id": 18, + "method": "tools/call", + "params": { + "name": "gks_pipeline_evidence", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-LOST-RESPONSE-REPLAY.json b/tests/fixtures/c0-qualification/cases/C0.4-LOST-RESPONSE-REPLAY.json new file mode 100644 index 0000000..0a62055 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-LOST-RESPONSE-REPLAY.json @@ -0,0 +1,749 @@ +{ + "id": "C0.4-LOST-RESPONSE-REPLAY", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "kill-after-commit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-lost", + "run_id": "c0-lost-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-lost", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "until": { + "sql": "SELECT knowledge_ref, source_hash FROM promotions WHERE idempotency_key = ?", + "params": [ + "c0-lost" + ] + } + }, + { + "kind": "restart" + }, + { + "kind": "call", + "name": "replay", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-lost", + "run_id": "c0-lost-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-lost", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true, + "match": { + "idempotent": true + } + } + }, + { + "kind": "call", + "name": "conflict", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-lost", + "run_id": "c0-lost-run", + "stage": 1, + "source_snapshot_hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "provenance_ref": "msp:proof/c0-lost", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "toolError": "gks_conflict" + } + }, + { + "kind": "kill-after-commit", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-lost-submit", + "idempotencyKey": "c0-lost-submit-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-lost-submit-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-9", + "attemptId": "c0-lost-submit-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-10", + "attemptId": "c0-lost-submit-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-11", + "attemptId": "c0-lost-submit-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-12", + "attemptId": "c0-lost-submit-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-13", + "attemptId": "c0-lost-submit-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-14", + "attemptId": "c0-lost-submit-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-15", + "attemptId": "c0-lost-submit-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-16", + "attemptId": "c0-lost-submit-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-17", + "attemptId": "c0-lost-submit-attempt-17" + } + ], + "source": { + "sourceId": "c0-lost-submit-source", + "rawArtifactId": "c0-lost-submit-raw", + "parsedArtifactId": "c0-lost-submit-parsed", + "documentId": "c0-lost-submit-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-lost-submit-chunk-1", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-lost-submit-chunk-2", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-lost-submit-chunk-3", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-lost-submit-chunk-4", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-lost-submit-chunk-5", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-lost-submit-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-lost-submit-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-lost-submit-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-lost-submit-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-lost-submit-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-lost-submit-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-lost-submit-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-lost-submit-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-lost-submit-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-lost-submit-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-lost-submit-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-lost-submit-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-lost-submit-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-lost-submit-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-lost-submit-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-lost-submit-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-lost-submit-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-lost-submit-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-lost-submit-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-lost-submit-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "until": { + "sql": "SELECT batch_id, decision_id FROM pipeline_batches WHERE idempotency_key = ?", + "params": [ + "c0-lost-submit-idempotency" + ] + } + }, + { + "kind": "restart" + }, + { + "kind": "call", + "name": "submitReplay", + "frame": { + "jsonrpc": "2.0", + "id": 5, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-lost-submit", + "idempotencyKey": "c0-lost-submit-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-lost-submit-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-9", + "attemptId": "c0-lost-submit-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-10", + "attemptId": "c0-lost-submit-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-11", + "attemptId": "c0-lost-submit-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-12", + "attemptId": "c0-lost-submit-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-13", + "attemptId": "c0-lost-submit-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-14", + "attemptId": "c0-lost-submit-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-15", + "attemptId": "c0-lost-submit-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-16", + "attemptId": "c0-lost-submit-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-lost-submit-run", + "executionStepId": "c0-lost-submit-step-17", + "attemptId": "c0-lost-submit-attempt-17" + } + ], + "source": { + "sourceId": "c0-lost-submit-source", + "rawArtifactId": "c0-lost-submit-raw", + "parsedArtifactId": "c0-lost-submit-parsed", + "documentId": "c0-lost-submit-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-lost-submit-chunk-1", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-lost-submit-chunk-2", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-lost-submit-chunk-3", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-lost-submit-chunk-4", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-lost-submit-chunk-5", + "parsedArtifactId": "c0-lost-submit-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-lost-submit-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-lost-submit-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-lost-submit-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-lost-submit-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-lost-submit-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-lost-submit-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-lost-submit-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-lost-submit-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-lost-submit-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-lost-submit-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-lost-submit-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-lost-submit-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-lost-submit-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-lost-submit-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-lost-submit-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-lost-submit-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-lost-submit-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-lost-submit-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-lost-submit-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-lost-submit-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-lost-submit", + "status": "PENDING", + "idempotent": true + } + } + }, + { + "kind": "store-query", + "sql": "SELECT (SELECT COUNT(*) FROM promotions WHERE idempotency_key = ?) AS promotions, (SELECT COUNT(*) FROM pipeline_batches WHERE idempotency_key = ?) AS batches", + "params": [ + "c0-lost", + "c0-lost-submit-idempotency" + ], + "expect": { + "rows": [ + { + "promotions": 1, + "batches": 1 + } + ] + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TENANT-WALL.json b/tests/fixtures/c0-qualification/cases/C0.4-TENANT-WALL.json new file mode 100644 index 0000000..31d9a33 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TENANT-WALL.json @@ -0,0 +1,325 @@ +{ + "id": "C0.4-TENANT-WALL", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "tenant", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-wall-tenant", + "run_id": "c0-wall-tenant-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-wall-tenant", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "tenantless", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-wall-tenantless", + "run_id": "c0-wall-tenantless-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-wall-tenantless", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "searchTenant", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_search", + "arguments": { + "query": "LINE", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true, + "match": [ + { + "scope": { + "tenantId": "c0-tenant" + } + } + ] + } + }, + { + "kind": "call", + "name": "searchTenantless", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_search", + "arguments": { + "query": "LINE", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true, + "match": [ + { + "scope": { + "tenantId": "" + } + } + ] + } + }, + { + "kind": "call", + "name": "searchOther", + "frame": { + "jsonrpc": "2.0", + "id": 5, + "method": "tools/call", + "params": { + "name": "gks_search", + "arguments": { + "query": "LINE", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant-b", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true, + "match": [] + } + }, + { + "kind": "call", + "name": "searchShared", + "frame": { + "jsonrpc": "2.0", + "id": 6, + "method": "tools/call", + "params": { + "name": "gks_search", + "arguments": { + "query": "LINE", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant-b", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "portfolio-shared" + } + } + } + }, + "expect": { + "ok": true, + "match": [] + } + }, + { + "kind": "call", + "name": "crossIntoTenantless", + "frame": { + "jsonrpc": "2.0", + "id": 7, + "method": "tools/call", + "params": { + "name": "gks_entity_get", + "arguments": { + "ref": { + "$bind": "tenantless.result.structuredContent.canonical_mappings.0.canonicalRef" + }, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "call", + "name": "crossIntoTenant", + "frame": { + "jsonrpc": "2.0", + "id": 8, + "method": "tools/call", + "params": { + "name": "gks_entity_get", + "arguments": { + "ref": { + "$bind": "tenant.result.structuredContent.canonical_mappings.0.canonicalRef" + }, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + }, + { + "kind": "call", + "name": "crossFromOther", + "frame": { + "jsonrpc": "2.0", + "id": 9, + "method": "tools/call", + "params": { + "name": "gks_relations_get", + "arguments": { + "ref": { + "$bind": "tenant.result.structuredContent.canonical_mappings.0.canonicalRef" + }, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant-b", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "toolError": "gks_scope_denied" + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-001.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-001.json new file mode 100644 index 0000000..4b48785 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-001.json @@ -0,0 +1,57 @@ +{ + "id": "C0.4-TOOL-001", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "initialize", + "params": {} + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/list", + "params": {} + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "health", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_health", + "arguments": {} + } + }, + "expect": { + "ok": true, + "match": { + "service": "gks", + "state": "ready" + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-002.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-002.json new file mode 100644 index 0000000..bdc72c1 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-002.json @@ -0,0 +1,127 @@ +{ + "id": "C0.4-TOOL-002", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-promote", + "run_id": "c0-tool-promote-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-tool-promote", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true, + "match": { + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "replay", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-promote", + "run_id": "c0-tool-promote-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-tool-promote", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true, + "match": { + "idempotent": true + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-003.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-003.json new file mode 100644 index 0000000..a7b8027 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-003.json @@ -0,0 +1,93 @@ +{ + "id": "C0.4-TOOL-003", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-search", + "run_id": "c0-tool-search-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-tool-search", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "search", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_search", + "arguments": { + "query": "LINE", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-004.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-004.json new file mode 100644 index 0000000..85ab787 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-004.json @@ -0,0 +1,98 @@ +{ + "id": "C0.4-TOOL-004", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-entity", + "run_id": "c0-tool-entity-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-tool-entity", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "entity", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_entity_get", + "arguments": { + "ref": { + "$bind": "promote.result.structuredContent.canonical_mappings.0.canonicalRef" + }, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true, + "match": { + "candidateRef": "FEAT-LINE-LINKING" + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-005.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-005.json new file mode 100644 index 0000000..e89e5a3 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-005.json @@ -0,0 +1,100 @@ +{ + "id": "C0.4-TOOL-005", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-relations", + "run_id": "c0-tool-relations-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-tool-relations", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "relations", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_relations_get", + "arguments": { + "ref": { + "$bind": "promote.result.structuredContent.canonical_mappings.0.canonicalRef" + }, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true, + "match": [ + { + "relationType": "DEPENDS_ON" + } + ] + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-006.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-006.json new file mode 100644 index 0000000..5f9c872 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-006.json @@ -0,0 +1,101 @@ +{ + "id": "C0.4-TOOL-006", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-artifact", + "run_id": "c0-tool-artifact-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-tool-artifact", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "link", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_artifact_link", + "arguments": { + "knowledgeRef": { + "$bind": "promote.result.structuredContent.canonical_mappings.0.canonicalRef" + }, + "artifactRef": "artifact:c0/spec-line-linking", + "relationType": "DESCRIBED_BY", + "evidenceRef": "msp:proof/c0-tool-artifact-link", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true, + "match": { + "relationType": "DESCRIBED_BY" + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-007.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-007.json new file mode 100644 index 0000000..7b1f44c --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-007.json @@ -0,0 +1,147 @@ +{ + "id": "C0.4-TOOL-007", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-review-list", + "run_id": "c0-tool-review-list-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-tool-review-list", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "conflict", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-review-list-2", + "run_id": "c0-tool-review-list-2-run", + "stage": 1, + "source_snapshot_hash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "provenance_ref": "msp:proof/c0-tool-review-list-2", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "A wholly different feature" + } + ], + "relations": [] + } + } + } + }, + "expect": { + "ok": true, + "match": { + "canonical_mappings": [ + { + "resolution": { + "outcome": "REVIEW_REQUIRED" + } + } + ] + } + } + }, + { + "kind": "call", + "name": "list", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_review_list", + "arguments": { + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true, + "match": [ + { + "outcome": "REVIEW_REQUIRED" + } + ] + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-008.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-008.json new file mode 100644 index 0000000..59f36cb --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-008.json @@ -0,0 +1,192 @@ +{ + "id": "C0.4-TOOL-008", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-review-apply", + "run_id": "c0-tool-review-apply-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-tool-review-apply", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "conflict", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-review-apply-2", + "run_id": "c0-tool-review-apply-2-run", + "stage": 1, + "source_snapshot_hash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "provenance_ref": "msp:proof/c0-tool-review-apply-2", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "A wholly different feature" + } + ], + "relations": [] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "list", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_review_list", + "arguments": { + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "apply", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_review_apply", + "arguments": { + "action": "BIND", + "provenanceRef": "msp:proof/c0-tool-review-apply-human", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "mentionId": { + "$bind": "list.result.structuredContent.0.mentionId" + }, + "canonicalRef": { + "$bind": "promote.result.structuredContent.canonical_mappings.0.canonicalRef" + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "after", + "frame": { + "jsonrpc": "2.0", + "id": 5, + "method": "tools/call", + "params": { + "name": "gks_review_list", + "arguments": { + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + } + } + } + }, + "expect": { + "ok": true, + "match": [] + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-009.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-009.json new file mode 100644 index 0000000..e667e2c --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-009.json @@ -0,0 +1,179 @@ +{ + "id": "C0.4-TOOL-009", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "promote", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-export", + "run_id": "c0-tool-export-run", + "stage": 1, + "source_snapshot_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "provenance_ref": "msp:proof/c0-tool-export", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "promote2", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_knowledge_promote", + "arguments": { + "schema_version": "govibe-knowledge-candidate/v1", + "idempotency_key": "c0-tool-export-2", + "run_id": "c0-tool-export-2-run", + "stage": 1, + "source_snapshot_hash": "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd", + "provenance_ref": "msp:proof/c0-tool-export-2", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "candidate": { + "entities": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity." + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "type": "ENTITY", + "title": "Customer identity", + "summary": "Canonical customer identity concept." + } + ], + "relations": [ + { + "fromRef": "FEAT-LINE-LINKING", + "relationType": "DEPENDS_ON", + "toRef": "ENTITY-CUSTOMER-IDENTITY" + } + ] + } + } + } + }, + "expect": { + "ok": true + } + }, + { + "kind": "call", + "name": "page1", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_stage_evidence_export", + "arguments": { + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "limit": 1 + } + } + }, + "expect": { + "ok": true, + "match": { + "next_cursor": 1 + } + } + }, + { + "kind": "call", + "name": "page2", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_stage_evidence_export", + "arguments": { + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "since_cursor": 1 + } + } + }, + "expect": { + "ok": true, + "match": { + "next_cursor": 2 + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-010.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-010.json new file mode 100644 index 0000000..21e780d --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-010.json @@ -0,0 +1,561 @@ +{ + "id": "C0.4-TOOL-010", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "submit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-submit", + "idempotencyKey": "c0-submit-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-submit-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-9", + "attemptId": "c0-submit-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-10", + "attemptId": "c0-submit-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-11", + "attemptId": "c0-submit-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-12", + "attemptId": "c0-submit-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-13", + "attemptId": "c0-submit-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-14", + "attemptId": "c0-submit-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-15", + "attemptId": "c0-submit-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-16", + "attemptId": "c0-submit-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-17", + "attemptId": "c0-submit-attempt-17" + } + ], + "source": { + "sourceId": "c0-submit-source", + "rawArtifactId": "c0-submit-raw", + "parsedArtifactId": "c0-submit-parsed", + "documentId": "c0-submit-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-submit-chunk-1", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-submit-chunk-2", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-submit-chunk-3", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-submit-chunk-4", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-submit-chunk-5", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-submit-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-submit-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-submit-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-submit-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-submit-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-submit-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-submit-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-submit-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-submit-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-submit-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-submit-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-submit-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-submit-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-submit-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-submit-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-submit-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-submit-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-submit-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-submit-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-submit-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-submit", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "replay", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-submit", + "idempotencyKey": "c0-submit-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-submit-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-9", + "attemptId": "c0-submit-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-10", + "attemptId": "c0-submit-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-11", + "attemptId": "c0-submit-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-12", + "attemptId": "c0-submit-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-13", + "attemptId": "c0-submit-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-14", + "attemptId": "c0-submit-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-15", + "attemptId": "c0-submit-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-16", + "attemptId": "c0-submit-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-submit-run", + "executionStepId": "c0-submit-step-17", + "attemptId": "c0-submit-attempt-17" + } + ], + "source": { + "sourceId": "c0-submit-source", + "rawArtifactId": "c0-submit-raw", + "parsedArtifactId": "c0-submit-parsed", + "documentId": "c0-submit-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-submit-chunk-1", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-submit-chunk-2", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-submit-chunk-3", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-submit-chunk-4", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-submit-chunk-5", + "parsedArtifactId": "c0-submit-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-submit-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-submit-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-submit-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-submit-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-submit-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-submit-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-submit-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-submit-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-submit-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-submit-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-submit-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-submit-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-submit-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-submit-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-submit-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-submit-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-submit-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-submit-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-submit-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-submit-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "idempotent": true + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-011.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-011.json new file mode 100644 index 0000000..b8f359a --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-011.json @@ -0,0 +1,335 @@ +{ + "id": "C0.4-TOOL-011", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "submit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-claim", + "idempotencyKey": "c0-claim-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-claim-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-claim-run", + "executionStepId": "c0-claim-step-9", + "attemptId": "c0-claim-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-claim-run", + "executionStepId": "c0-claim-step-10", + "attemptId": "c0-claim-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-claim-run", + "executionStepId": "c0-claim-step-11", + "attemptId": "c0-claim-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-claim-run", + "executionStepId": "c0-claim-step-12", + "attemptId": "c0-claim-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-claim-run", + "executionStepId": "c0-claim-step-13", + "attemptId": "c0-claim-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-claim-run", + "executionStepId": "c0-claim-step-14", + "attemptId": "c0-claim-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-claim-run", + "executionStepId": "c0-claim-step-15", + "attemptId": "c0-claim-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-claim-run", + "executionStepId": "c0-claim-step-16", + "attemptId": "c0-claim-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-claim-run", + "executionStepId": "c0-claim-step-17", + "attemptId": "c0-claim-attempt-17" + } + ], + "source": { + "sourceId": "c0-claim-source", + "rawArtifactId": "c0-claim-raw", + "parsedArtifactId": "c0-claim-parsed", + "documentId": "c0-claim-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-claim-chunk-1", + "parsedArtifactId": "c0-claim-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-claim-chunk-2", + "parsedArtifactId": "c0-claim-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-claim-chunk-3", + "parsedArtifactId": "c0-claim-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-claim-chunk-4", + "parsedArtifactId": "c0-claim-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-claim-chunk-5", + "parsedArtifactId": "c0-claim-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-claim-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-claim-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-claim-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-claim-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-claim-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-claim-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-claim-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-claim-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-claim-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-claim-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-claim-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-claim-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-claim-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-claim-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-claim-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-claim-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-claim-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-claim-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-claim-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-claim-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-claim", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "claim", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_pipeline_claim", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "decisions": [ + { + "batchId": "c0-claim", + "decisionId": "gks:decision/2f79b27ec6225c2fa15f0ae84134951d" + } + ] + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-012.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-012.json new file mode 100644 index 0000000..e10c3d9 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-012.json @@ -0,0 +1,605 @@ +{ + "id": "C0.4-TOOL-012", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "submit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-graph", + "idempotencyKey": "c0-graph-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-graph-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-graph-run", + "executionStepId": "c0-graph-step-9", + "attemptId": "c0-graph-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-graph-run", + "executionStepId": "c0-graph-step-10", + "attemptId": "c0-graph-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-graph-run", + "executionStepId": "c0-graph-step-11", + "attemptId": "c0-graph-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-graph-run", + "executionStepId": "c0-graph-step-12", + "attemptId": "c0-graph-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-graph-run", + "executionStepId": "c0-graph-step-13", + "attemptId": "c0-graph-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-graph-run", + "executionStepId": "c0-graph-step-14", + "attemptId": "c0-graph-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-graph-run", + "executionStepId": "c0-graph-step-15", + "attemptId": "c0-graph-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-graph-run", + "executionStepId": "c0-graph-step-16", + "attemptId": "c0-graph-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-graph-run", + "executionStepId": "c0-graph-step-17", + "attemptId": "c0-graph-attempt-17" + } + ], + "source": { + "sourceId": "c0-graph-source", + "rawArtifactId": "c0-graph-raw", + "parsedArtifactId": "c0-graph-parsed", + "documentId": "c0-graph-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-graph-chunk-1", + "parsedArtifactId": "c0-graph-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-graph-chunk-2", + "parsedArtifactId": "c0-graph-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-graph-chunk-3", + "parsedArtifactId": "c0-graph-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-graph-chunk-4", + "parsedArtifactId": "c0-graph-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-graph-chunk-5", + "parsedArtifactId": "c0-graph-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-graph-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-graph-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-graph-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-graph-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-graph-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-graph-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-graph-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-graph-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-graph-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-graph-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-graph-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-graph-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-graph-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-graph-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-graph-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-graph-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-graph-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-graph-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-graph-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-graph-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-graph", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "claim", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_pipeline_claim", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "decisions": [ + { + "batchId": "c0-graph", + "decisionId": "gks:decision/1e310d8ecb8d8d01e75ff8bd1c6adf4e" + } + ] + } + } + }, + { + "kind": "call", + "name": "graph", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-graph-run", + "decisionId": "gks:decision/1e310d8ecb8d8d01e75ff8bd1c6adf4e", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-graph-attempt-9", + "executionStepId": "c0-graph-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-graph-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-graph-attempt-10", + "executionStepId": "c0-graph-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-graph-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-graph-attempt-11", + "executionStepId": "c0-graph-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-graph-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-graph-attempt-12", + "executionStepId": "c0-graph-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-graph-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-graph-attempt-13", + "executionStepId": "c0-graph-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-graph-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-graph-attempt-14", + "executionStepId": "c0-graph-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-graph-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-graph-attempt-15", + "executionStepId": "c0-graph-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-graph-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-graph-attempt-16", + "executionStepId": "c0-graph-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-graph-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-graph-attempt-17", + "executionStepId": "c0-graph-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-graph-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-graph-graph-tx", + "frontier": "c0-graph-graph-frontier", + "checkpoint": "c0-graph-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "replay", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-graph-run", + "decisionId": "gks:decision/1e310d8ecb8d8d01e75ff8bd1c6adf4e", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-graph-attempt-9", + "executionStepId": "c0-graph-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-graph-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-graph-attempt-10", + "executionStepId": "c0-graph-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-graph-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-graph-attempt-11", + "executionStepId": "c0-graph-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-graph-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-graph-attempt-12", + "executionStepId": "c0-graph-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-graph-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-graph-attempt-13", + "executionStepId": "c0-graph-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-graph-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-graph-attempt-14", + "executionStepId": "c0-graph-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-graph-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-graph-attempt-15", + "executionStepId": "c0-graph-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-graph-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-graph-attempt-16", + "executionStepId": "c0-graph-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-graph-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-graph-attempt-17", + "executionStepId": "c0-graph-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-graph-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-graph-graph-tx", + "frontier": "c0-graph-graph-frontier", + "checkpoint": "c0-graph-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": true + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-013.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-013.json new file mode 100644 index 0000000..be75a15 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-013.json @@ -0,0 +1,542 @@ +{ + "id": "C0.4-TOOL-013", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "submit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-failure", + "idempotencyKey": "c0-failure-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-failure-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-9", + "attemptId": "c0-failure-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-10", + "attemptId": "c0-failure-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-11", + "attemptId": "c0-failure-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-12", + "attemptId": "c0-failure-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-13", + "attemptId": "c0-failure-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-14", + "attemptId": "c0-failure-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-15", + "attemptId": "c0-failure-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-16", + "attemptId": "c0-failure-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-17", + "attemptId": "c0-failure-attempt-17" + } + ], + "source": { + "sourceId": "c0-failure-source", + "rawArtifactId": "c0-failure-raw", + "parsedArtifactId": "c0-failure-parsed", + "documentId": "c0-failure-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-failure-chunk-1", + "parsedArtifactId": "c0-failure-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-failure-chunk-2", + "parsedArtifactId": "c0-failure-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-failure-chunk-3", + "parsedArtifactId": "c0-failure-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-failure-chunk-4", + "parsedArtifactId": "c0-failure-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-failure-chunk-5", + "parsedArtifactId": "c0-failure-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-failure-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-failure-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-failure-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-failure-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-failure-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-failure-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-failure-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-failure-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-failure-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-failure-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-failure-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-failure-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-failure-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-failure-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-failure-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-failure-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-failure-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-failure-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-failure-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-failure-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-failure", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "claim", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_pipeline_claim", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "decisions": [ + { + "batchId": "c0-failure", + "decisionId": "gks:decision/8225cee9db4349766f70351d26aa3c65" + } + ] + } + } + }, + { + "kind": "call", + "name": "graph", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-failure-run", + "decisionId": "gks:decision/8225cee9db4349766f70351d26aa3c65", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-failure-attempt-9", + "executionStepId": "c0-failure-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-failure-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-failure-attempt-10", + "executionStepId": "c0-failure-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-failure-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-failure-attempt-11", + "executionStepId": "c0-failure-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-failure-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-failure-attempt-12", + "executionStepId": "c0-failure-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-failure-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-failure-attempt-13", + "executionStepId": "c0-failure-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-failure-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-failure-attempt-14", + "executionStepId": "c0-failure-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-failure-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-failure-attempt-15", + "executionStepId": "c0-failure-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-failure-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-failure-attempt-16", + "executionStepId": "c0-failure-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-failure-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-failure-attempt-17", + "executionStepId": "c0-failure-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-failure-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-failure-graph-tx", + "frontier": "c0-failure-graph-frontier", + "checkpoint": "c0-failure-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "failure", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_pipeline_stage_failure", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-failure-run", + "decisionId": "gks:decision/8225cee9db4349766f70351d26aa3c65", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stage": { + "attemptId": "c0-failure-attempt-15", + "executionStepId": "c0-failure-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-failure-run", + "stageNumber": 15 + }, + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z", + "metrics": { + "records_in": 1, + "records_out": 1, + "records_quarantined": 0, + "error_count": 1, + "retry_count": 0, + "duration_ms": 1 + }, + "error": { + "code": "INDEX_WRITE_FAILED", + "message": "C0 fixture index write failure" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false, + "stage": { + "stageNumber": 15 + } + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-014.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-014.json new file mode 100644 index 0000000..2939846 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-014.json @@ -0,0 +1,694 @@ +{ + "id": "C0.4-TOOL-014", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "submit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-write", + "idempotencyKey": "c0-write-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-write-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-write-run", + "executionStepId": "c0-write-step-9", + "attemptId": "c0-write-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-write-run", + "executionStepId": "c0-write-step-10", + "attemptId": "c0-write-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-write-run", + "executionStepId": "c0-write-step-11", + "attemptId": "c0-write-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-write-run", + "executionStepId": "c0-write-step-12", + "attemptId": "c0-write-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-write-run", + "executionStepId": "c0-write-step-13", + "attemptId": "c0-write-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-write-run", + "executionStepId": "c0-write-step-14", + "attemptId": "c0-write-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-write-run", + "executionStepId": "c0-write-step-15", + "attemptId": "c0-write-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-write-run", + "executionStepId": "c0-write-step-16", + "attemptId": "c0-write-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-write-run", + "executionStepId": "c0-write-step-17", + "attemptId": "c0-write-attempt-17" + } + ], + "source": { + "sourceId": "c0-write-source", + "rawArtifactId": "c0-write-raw", + "parsedArtifactId": "c0-write-parsed", + "documentId": "c0-write-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-write-chunk-1", + "parsedArtifactId": "c0-write-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-write-chunk-2", + "parsedArtifactId": "c0-write-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-write-chunk-3", + "parsedArtifactId": "c0-write-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-write-chunk-4", + "parsedArtifactId": "c0-write-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-write-chunk-5", + "parsedArtifactId": "c0-write-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-write-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-write-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-write-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-write-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-write-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-write-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-write-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-write-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-write-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-write-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-write-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-write-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-write-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-write-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-write-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-write-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-write-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-write-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-write-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-write-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-write", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "claim", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_pipeline_claim", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "decisions": [ + { + "batchId": "c0-write", + "decisionId": "gks:decision/fb5b3cb608d43044146667e48f0fa41a" + } + ] + } + } + }, + { + "kind": "call", + "name": "graph", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-write-run", + "decisionId": "gks:decision/fb5b3cb608d43044146667e48f0fa41a", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-write-attempt-9", + "executionStepId": "c0-write-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-write-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-write-attempt-10", + "executionStepId": "c0-write-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-write-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-write-attempt-11", + "executionStepId": "c0-write-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-write-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-write-attempt-12", + "executionStepId": "c0-write-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-write-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-write-attempt-13", + "executionStepId": "c0-write-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-write-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-write-attempt-14", + "executionStepId": "c0-write-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-write-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-write-attempt-15", + "executionStepId": "c0-write-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-write-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-write-attempt-16", + "executionStepId": "c0-write-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-write-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-write-attempt-17", + "executionStepId": "c0-write-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-write-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-write-graph-tx", + "frontier": "c0-write-graph-frontier", + "checkpoint": "c0-write-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "write", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_pipeline_write_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-write-run", + "decisionId": "gks:decision/fb5b3cb608d43044146667e48f0fa41a", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-write-attempt-9", + "executionStepId": "c0-write-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-write-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-write-attempt-10", + "executionStepId": "c0-write-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-write-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-write-attempt-11", + "executionStepId": "c0-write-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-write-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-write-attempt-12", + "executionStepId": "c0-write-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-write-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-write-attempt-13", + "executionStepId": "c0-write-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-write-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-write-attempt-14", + "executionStepId": "c0-write-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-write-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-write-attempt-15", + "executionStepId": "c0-write-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-write-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-write-attempt-16", + "executionStepId": "c0-write-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-write-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-write-attempt-17", + "executionStepId": "c0-write-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-write-run", + "stageNumber": 17 + } + ], + "graphReceiptHash": { + "$bind": "graph.result.structuredContent.graphReceiptHash" + }, + "derivedHash": { + "$bind": "graph.result.structuredContent.derivedHash" + }, + "executionTimes": { + "13": { + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "15": { + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z" + }, + "16": { + "startedAt": "2026-09-07T15:00:02.000Z", + "finishedAt": "2026-09-07T15:00:02.100Z" + } + }, + "snapshotId": "c0-write-snapshot", + "generation": "c0-write-generation", + "model": { + "id": "intfloat/multilingual-e5-small", + "revision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "dimensions": 384, + "metric": "cosine", + "artifactHashes": { + "model.safetensors": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + }, + "transaction": { + "id": "c0-write-final-tx", + "frontier": "c0-write-final-frontier", + "checkpoint": "c0-write-final-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 28, + "edgeCount": 44, + "vectorCount": 5, + "citationCount": 5 + }, + "laneManifest": { + "vector": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "lexical": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "graph": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 44 + }, + "sqlite": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 28 + }, + "bitemporal": { + "status": "not_applicable", + "reason": "frozen-fixture", + "objects": 0 + }, + "provenance": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + } + }, + "metrics": { + "13": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "15": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "16": { + "records_in": 72, + "records_out": 72, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + } + }, + "benchmark": { + "fixtureVersion": "ki17-corpus-v1", + "queryCount": 5, + "recallAt5": 1, + "mrr": 1, + "citationCorrectness": 1, + "crossTenantLeaks": 0 + } + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-015.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-015.json new file mode 100644 index 0000000..62c970c --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-015.json @@ -0,0 +1,743 @@ +{ + "id": "C0.4-TOOL-015", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "submit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-gate", + "idempotencyKey": "c0-gate-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-gate-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-gate-run", + "executionStepId": "c0-gate-step-9", + "attemptId": "c0-gate-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-gate-run", + "executionStepId": "c0-gate-step-10", + "attemptId": "c0-gate-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-gate-run", + "executionStepId": "c0-gate-step-11", + "attemptId": "c0-gate-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-gate-run", + "executionStepId": "c0-gate-step-12", + "attemptId": "c0-gate-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-gate-run", + "executionStepId": "c0-gate-step-13", + "attemptId": "c0-gate-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-gate-run", + "executionStepId": "c0-gate-step-14", + "attemptId": "c0-gate-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-gate-run", + "executionStepId": "c0-gate-step-15", + "attemptId": "c0-gate-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-gate-run", + "executionStepId": "c0-gate-step-16", + "attemptId": "c0-gate-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-gate-run", + "executionStepId": "c0-gate-step-17", + "attemptId": "c0-gate-attempt-17" + } + ], + "source": { + "sourceId": "c0-gate-source", + "rawArtifactId": "c0-gate-raw", + "parsedArtifactId": "c0-gate-parsed", + "documentId": "c0-gate-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-gate-chunk-1", + "parsedArtifactId": "c0-gate-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-gate-chunk-2", + "parsedArtifactId": "c0-gate-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-gate-chunk-3", + "parsedArtifactId": "c0-gate-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-gate-chunk-4", + "parsedArtifactId": "c0-gate-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-gate-chunk-5", + "parsedArtifactId": "c0-gate-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-gate-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-gate-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-gate-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-gate-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-gate-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-gate-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-gate-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-gate-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-gate-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-gate-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-gate-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-gate-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-gate-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-gate-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-gate-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-gate-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-gate-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-gate-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-gate-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-gate-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-gate", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "claim", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_pipeline_claim", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "decisions": [ + { + "batchId": "c0-gate", + "decisionId": "gks:decision/1863de235e3aeee293ec8b0b4cec6958" + } + ] + } + } + }, + { + "kind": "call", + "name": "graph", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-gate-run", + "decisionId": "gks:decision/1863de235e3aeee293ec8b0b4cec6958", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-gate-attempt-9", + "executionStepId": "c0-gate-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-gate-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-gate-attempt-10", + "executionStepId": "c0-gate-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-gate-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-gate-attempt-11", + "executionStepId": "c0-gate-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-gate-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-gate-attempt-12", + "executionStepId": "c0-gate-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-gate-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-gate-attempt-13", + "executionStepId": "c0-gate-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-gate-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-gate-attempt-14", + "executionStepId": "c0-gate-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-gate-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-gate-attempt-15", + "executionStepId": "c0-gate-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-gate-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-gate-attempt-16", + "executionStepId": "c0-gate-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-gate-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-gate-attempt-17", + "executionStepId": "c0-gate-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-gate-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-gate-graph-tx", + "frontier": "c0-gate-graph-frontier", + "checkpoint": "c0-gate-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "write", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_pipeline_write_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-gate-run", + "decisionId": "gks:decision/1863de235e3aeee293ec8b0b4cec6958", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-gate-attempt-9", + "executionStepId": "c0-gate-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-gate-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-gate-attempt-10", + "executionStepId": "c0-gate-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-gate-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-gate-attempt-11", + "executionStepId": "c0-gate-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-gate-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-gate-attempt-12", + "executionStepId": "c0-gate-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-gate-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-gate-attempt-13", + "executionStepId": "c0-gate-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-gate-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-gate-attempt-14", + "executionStepId": "c0-gate-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-gate-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-gate-attempt-15", + "executionStepId": "c0-gate-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-gate-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-gate-attempt-16", + "executionStepId": "c0-gate-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-gate-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-gate-attempt-17", + "executionStepId": "c0-gate-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-gate-run", + "stageNumber": 17 + } + ], + "graphReceiptHash": { + "$bind": "graph.result.structuredContent.graphReceiptHash" + }, + "derivedHash": { + "$bind": "graph.result.structuredContent.derivedHash" + }, + "executionTimes": { + "13": { + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "15": { + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z" + }, + "16": { + "startedAt": "2026-09-07T15:00:02.000Z", + "finishedAt": "2026-09-07T15:00:02.100Z" + } + }, + "snapshotId": "c0-gate-snapshot", + "generation": "c0-gate-generation", + "model": { + "id": "intfloat/multilingual-e5-small", + "revision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "dimensions": 384, + "metric": "cosine", + "artifactHashes": { + "model.safetensors": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + }, + "transaction": { + "id": "c0-gate-final-tx", + "frontier": "c0-gate-final-frontier", + "checkpoint": "c0-gate-final-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 28, + "edgeCount": 44, + "vectorCount": 5, + "citationCount": 5 + }, + "laneManifest": { + "vector": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "lexical": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "graph": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 44 + }, + "sqlite": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 28 + }, + "bitemporal": { + "status": "not_applicable", + "reason": "frozen-fixture", + "objects": 0 + }, + "provenance": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + } + }, + "metrics": { + "13": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "15": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "16": { + "records_in": 72, + "records_out": 72, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + } + }, + "benchmark": { + "fixtureVersion": "ki17-corpus-v1", + "queryCount": 5, + "recallAt5": 1, + "mrr": 1, + "citationCorrectness": 1, + "crossTenantLeaks": 0 + } + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "gate", + "frame": { + "jsonrpc": "2.0", + "id": 5, + "method": "tools/call", + "params": { + "name": "gks_pipeline_gate", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisionId": "gks:decision/1863de235e3aeee293ec8b0b4cec6958", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "verdict": { + "verdict": "PASS", + "allowPublication": true + } + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-016.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-016.json new file mode 100644 index 0000000..5cf8768 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-016.json @@ -0,0 +1,805 @@ +{ + "id": "C0.4-TOOL-016", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "submit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-publication", + "idempotencyKey": "c0-publication-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-publication-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-publication-run", + "executionStepId": "c0-publication-step-9", + "attemptId": "c0-publication-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-publication-run", + "executionStepId": "c0-publication-step-10", + "attemptId": "c0-publication-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-publication-run", + "executionStepId": "c0-publication-step-11", + "attemptId": "c0-publication-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-publication-run", + "executionStepId": "c0-publication-step-12", + "attemptId": "c0-publication-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-publication-run", + "executionStepId": "c0-publication-step-13", + "attemptId": "c0-publication-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-publication-run", + "executionStepId": "c0-publication-step-14", + "attemptId": "c0-publication-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-publication-run", + "executionStepId": "c0-publication-step-15", + "attemptId": "c0-publication-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-publication-run", + "executionStepId": "c0-publication-step-16", + "attemptId": "c0-publication-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-publication-run", + "executionStepId": "c0-publication-step-17", + "attemptId": "c0-publication-attempt-17" + } + ], + "source": { + "sourceId": "c0-publication-source", + "rawArtifactId": "c0-publication-raw", + "parsedArtifactId": "c0-publication-parsed", + "documentId": "c0-publication-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-publication-chunk-1", + "parsedArtifactId": "c0-publication-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-publication-chunk-2", + "parsedArtifactId": "c0-publication-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-publication-chunk-3", + "parsedArtifactId": "c0-publication-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-publication-chunk-4", + "parsedArtifactId": "c0-publication-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-publication-chunk-5", + "parsedArtifactId": "c0-publication-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-publication-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-publication-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-publication-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-publication-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-publication-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-publication-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-publication-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-publication-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-publication-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-publication-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-publication-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-publication-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-publication-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-publication-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-publication-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-publication-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-publication-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-publication-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-publication-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-publication-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-publication", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "claim", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_pipeline_claim", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "decisions": [ + { + "batchId": "c0-publication", + "decisionId": "gks:decision/fc9c8fe58efaa42f511dc31cb3bad177" + } + ] + } + } + }, + { + "kind": "call", + "name": "graph", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-publication-run", + "decisionId": "gks:decision/fc9c8fe58efaa42f511dc31cb3bad177", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-publication-attempt-9", + "executionStepId": "c0-publication-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-publication-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-publication-attempt-10", + "executionStepId": "c0-publication-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-publication-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-publication-attempt-11", + "executionStepId": "c0-publication-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-publication-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-publication-attempt-12", + "executionStepId": "c0-publication-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-publication-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-publication-attempt-13", + "executionStepId": "c0-publication-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-publication-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-publication-attempt-14", + "executionStepId": "c0-publication-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-publication-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-publication-attempt-15", + "executionStepId": "c0-publication-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-publication-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-publication-attempt-16", + "executionStepId": "c0-publication-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-publication-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-publication-attempt-17", + "executionStepId": "c0-publication-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-publication-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-publication-graph-tx", + "frontier": "c0-publication-graph-frontier", + "checkpoint": "c0-publication-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "write", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_pipeline_write_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-publication-run", + "decisionId": "gks:decision/fc9c8fe58efaa42f511dc31cb3bad177", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-publication-attempt-9", + "executionStepId": "c0-publication-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-publication-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-publication-attempt-10", + "executionStepId": "c0-publication-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-publication-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-publication-attempt-11", + "executionStepId": "c0-publication-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-publication-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-publication-attempt-12", + "executionStepId": "c0-publication-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-publication-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-publication-attempt-13", + "executionStepId": "c0-publication-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-publication-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-publication-attempt-14", + "executionStepId": "c0-publication-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-publication-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-publication-attempt-15", + "executionStepId": "c0-publication-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-publication-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-publication-attempt-16", + "executionStepId": "c0-publication-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-publication-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-publication-attempt-17", + "executionStepId": "c0-publication-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-publication-run", + "stageNumber": 17 + } + ], + "graphReceiptHash": { + "$bind": "graph.result.structuredContent.graphReceiptHash" + }, + "derivedHash": { + "$bind": "graph.result.structuredContent.derivedHash" + }, + "executionTimes": { + "13": { + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "15": { + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z" + }, + "16": { + "startedAt": "2026-09-07T15:00:02.000Z", + "finishedAt": "2026-09-07T15:00:02.100Z" + } + }, + "snapshotId": "c0-publication-snapshot", + "generation": "c0-publication-generation", + "model": { + "id": "intfloat/multilingual-e5-small", + "revision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "dimensions": 384, + "metric": "cosine", + "artifactHashes": { + "model.safetensors": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + }, + "transaction": { + "id": "c0-publication-final-tx", + "frontier": "c0-publication-final-frontier", + "checkpoint": "c0-publication-final-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 28, + "edgeCount": 44, + "vectorCount": 5, + "citationCount": 5 + }, + "laneManifest": { + "vector": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "lexical": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "graph": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 44 + }, + "sqlite": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 28 + }, + "bitemporal": { + "status": "not_applicable", + "reason": "frozen-fixture", + "objects": 0 + }, + "provenance": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + } + }, + "metrics": { + "13": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "15": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "16": { + "records_in": 72, + "records_out": 72, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + } + }, + "benchmark": { + "fixtureVersion": "ki17-corpus-v1", + "queryCount": 5, + "recallAt5": 1, + "mrr": 1, + "citationCorrectness": 1, + "crossTenantLeaks": 0 + } + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "gate", + "frame": { + "jsonrpc": "2.0", + "id": 5, + "method": "tools/call", + "params": { + "name": "gks_pipeline_gate", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisionId": "gks:decision/fc9c8fe58efaa42f511dc31cb3bad177", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "verdict": { + "verdict": "PASS", + "allowPublication": true + } + } + } + }, + { + "kind": "call", + "name": "publication", + "frame": { + "jsonrpc": "2.0", + "id": 6, + "method": "tools/call", + "params": { + "name": "gks_pipeline_publication_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-publication-run", + "decisionId": "gks:decision/fc9c8fe58efaa42f511dc31cb3bad177", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "snapshotId": "c0-publication-snapshot", + "generation": "c0-publication-generation", + "receiptHash": { + "$bind": "write.result.structuredContent.receiptHash" + }, + "publishedAt": "2026-09-07T15:00:03.000Z", + "pointerHash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "modelRevision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "transactionFrontier": "c0-publication-final-frontier", + "readback": { + "ok": true + } + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TOOL-017.json b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-017.json new file mode 100644 index 0000000..b0e7ad6 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TOOL-017.json @@ -0,0 +1,845 @@ +{ + "id": "C0.4-TOOL-017", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "call", + "name": "submit", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_pipeline_submit", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batch": { + "schemaVersion": "genesisrag17.v1", + "batchId": "c0-evidence", + "idempotencyKey": "c0-evidence-idempotency", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "stages": [ + { + "stageNumber": 9, + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-evidence-run", + "executionStepId": "c0-evidence-step-9", + "attemptId": "c0-evidence-attempt-9" + }, + { + "stageNumber": 10, + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-evidence-run", + "executionStepId": "c0-evidence-step-10", + "attemptId": "c0-evidence-attempt-10" + }, + { + "stageNumber": 11, + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-evidence-run", + "executionStepId": "c0-evidence-step-11", + "attemptId": "c0-evidence-attempt-11" + }, + { + "stageNumber": 12, + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-evidence-run", + "executionStepId": "c0-evidence-step-12", + "attemptId": "c0-evidence-attempt-12" + }, + { + "stageNumber": 13, + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-evidence-run", + "executionStepId": "c0-evidence-step-13", + "attemptId": "c0-evidence-attempt-13" + }, + { + "stageNumber": 14, + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-evidence-run", + "executionStepId": "c0-evidence-step-14", + "attemptId": "c0-evidence-attempt-14" + }, + { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-evidence-run", + "executionStepId": "c0-evidence-step-15", + "attemptId": "c0-evidence-attempt-15" + }, + { + "stageNumber": 16, + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-evidence-run", + "executionStepId": "c0-evidence-step-16", + "attemptId": "c0-evidence-attempt-16" + }, + { + "stageNumber": 17, + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-evidence-run", + "executionStepId": "c0-evidence-step-17", + "attemptId": "c0-evidence-attempt-17" + } + ], + "source": { + "sourceId": "c0-evidence-source", + "rawArtifactId": "c0-evidence-raw", + "parsedArtifactId": "c0-evidence-parsed", + "documentId": "c0-evidence-document", + "version": "1", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd." + }, + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "chunks": [ + { + "chunkId": "c0-evidence-chunk-1", + "parsedArtifactId": "c0-evidence-parsed", + "ordinal": 0, + "text": "Alice works for Acme Ltd.", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "startOffset": 0, + "endOffset": 25 + }, + { + "chunkId": "c0-evidence-chunk-2", + "parsedArtifactId": "c0-evidence-parsed", + "ordinal": 1, + "text": "Alice purchased Atlas.", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "startOffset": 26, + "endOffset": 48 + }, + { + "chunkId": "c0-evidence-chunk-3", + "parsedArtifactId": "c0-evidence-parsed", + "ordinal": 2, + "text": "Bob works for Beacon Ltd.", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "startOffset": 49, + "endOffset": 74 + }, + { + "chunkId": "c0-evidence-chunk-4", + "parsedArtifactId": "c0-evidence-parsed", + "ordinal": 3, + "text": "Bob purchased Nimbus.", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "startOffset": 75, + "endOffset": 96 + }, + { + "chunkId": "c0-evidence-chunk-5", + "parsedArtifactId": "c0-evidence-parsed", + "ordinal": 4, + "text": "Carol works for Cedar Ltd.", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "startOffset": 97, + "endOffset": 123 + } + ], + "mentions": [ + { + "sourceMentionId": "c0-evidence-mention-1-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-evidence-chunk-1", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-evidence-mention-1-2", + "resolutionKey": "acme", + "semanticType": "Organization", + "name": "Acme Ltd.", + "chunkId": "c0-evidence-chunk-1", + "startOffset": 16, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-evidence-mention-2-1", + "resolutionKey": "alice", + "semanticType": "Person", + "name": "Alice", + "chunkId": "c0-evidence-chunk-2", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-evidence-mention-2-2", + "resolutionKey": "atlas", + "semanticType": "Product", + "name": "Atlas", + "chunkId": "c0-evidence-chunk-2", + "startOffset": 16, + "endOffset": 21 + }, + { + "sourceMentionId": "c0-evidence-mention-3-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-evidence-chunk-3", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-evidence-mention-3-2", + "resolutionKey": "beacon", + "semanticType": "Organization", + "name": "Beacon Ltd.", + "chunkId": "c0-evidence-chunk-3", + "startOffset": 14, + "endOffset": 25 + }, + { + "sourceMentionId": "c0-evidence-mention-4-1", + "resolutionKey": "bob", + "semanticType": "Person", + "name": "Bob", + "chunkId": "c0-evidence-chunk-4", + "startOffset": 0, + "endOffset": 3 + }, + { + "sourceMentionId": "c0-evidence-mention-4-2", + "resolutionKey": "nimbus", + "semanticType": "Product", + "name": "Nimbus", + "chunkId": "c0-evidence-chunk-4", + "startOffset": 14, + "endOffset": 20 + }, + { + "sourceMentionId": "c0-evidence-mention-5-1", + "resolutionKey": "carol", + "semanticType": "Person", + "name": "Carol", + "chunkId": "c0-evidence-chunk-5", + "startOffset": 0, + "endOffset": 5 + }, + { + "sourceMentionId": "c0-evidence-mention-5-2", + "resolutionKey": "cedar", + "semanticType": "Organization", + "name": "Cedar Ltd.", + "chunkId": "c0-evidence-chunk-5", + "startOffset": 16, + "endOffset": 26 + } + ] + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "batchId": "c0-evidence", + "status": "PENDING", + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "claim", + "frame": { + "jsonrpc": "2.0", + "id": 2, + "method": "tools/call", + "params": { + "name": "gks_pipeline_claim", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "decisions": [ + { + "batchId": "c0-evidence", + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143" + } + ] + } + } + }, + { + "kind": "call", + "name": "graph", + "frame": { + "jsonrpc": "2.0", + "id": 3, + "method": "tools/call", + "params": { + "name": "gks_pipeline_graph_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-evidence-run", + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-evidence-attempt-9", + "executionStepId": "c0-evidence-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-evidence-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-evidence-attempt-10", + "executionStepId": "c0-evidence-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-evidence-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-evidence-attempt-11", + "executionStepId": "c0-evidence-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-evidence-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-evidence-attempt-12", + "executionStepId": "c0-evidence-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-evidence-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-evidence-attempt-13", + "executionStepId": "c0-evidence-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-evidence-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-evidence-attempt-14", + "executionStepId": "c0-evidence-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-evidence-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-evidence-attempt-15", + "executionStepId": "c0-evidence-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-evidence-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-evidence-attempt-16", + "executionStepId": "c0-evidence-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-evidence-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-evidence-attempt-17", + "executionStepId": "c0-evidence-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-evidence-run", + "stageNumber": 17 + } + ], + "transaction": { + "id": "c0-evidence-graph-tx", + "frontier": "c0-evidence-graph-frontier", + "checkpoint": "c0-evidence-graph-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 20, + "edgeCount": 26 + }, + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "write", + "frame": { + "jsonrpc": "2.0", + "id": 4, + "method": "tools/call", + "params": { + "name": "gks_pipeline_write_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "runId": "c0-evidence-run", + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "stages": [ + { + "attemptId": "c0-evidence-attempt-9", + "executionStepId": "c0-evidence-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-evidence-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-evidence-attempt-10", + "executionStepId": "c0-evidence-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-evidence-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-evidence-attempt-11", + "executionStepId": "c0-evidence-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-evidence-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-evidence-attempt-12", + "executionStepId": "c0-evidence-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-evidence-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-evidence-attempt-13", + "executionStepId": "c0-evidence-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-evidence-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-evidence-attempt-14", + "executionStepId": "c0-evidence-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-evidence-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-evidence-attempt-15", + "executionStepId": "c0-evidence-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-evidence-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-evidence-attempt-16", + "executionStepId": "c0-evidence-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-evidence-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-evidence-attempt-17", + "executionStepId": "c0-evidence-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-evidence-run", + "stageNumber": 17 + } + ], + "graphReceiptHash": { + "$bind": "graph.result.structuredContent.graphReceiptHash" + }, + "derivedHash": { + "$bind": "graph.result.structuredContent.derivedHash" + }, + "executionTimes": { + "13": { + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z" + }, + "15": { + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z" + }, + "16": { + "startedAt": "2026-09-07T15:00:02.000Z", + "finishedAt": "2026-09-07T15:00:02.100Z" + } + }, + "snapshotId": "c0-evidence-snapshot", + "generation": "c0-evidence-generation", + "model": { + "id": "intfloat/multilingual-e5-small", + "revision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "dimensions": 384, + "metric": "cosine", + "artifactHashes": { + "model.safetensors": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + }, + "transaction": { + "id": "c0-evidence-final-tx", + "frontier": "c0-evidence-final-frontier", + "checkpoint": "c0-evidence-final-checkpoint" + }, + "readback": { + "ok": true, + "nodeCount": 28, + "edgeCount": 44, + "vectorCount": 5, + "citationCount": 5 + }, + "laneManifest": { + "vector": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "lexical": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + }, + "graph": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 44 + }, + "sqlite": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 28 + }, + "bitemporal": { + "status": "not_applicable", + "reason": "frozen-fixture", + "objects": 0 + }, + "provenance": { + "status": "ready", + "reason": "frozen-fixture", + "objects": 5 + } + }, + "metrics": { + "13": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "15": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + }, + "16": { + "records_in": 72, + "records_out": 72, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": 1 + } + }, + "benchmark": { + "fixtureVersion": "ki17-corpus-v1", + "queryCount": 5, + "recallAt5": 1, + "mrr": 1, + "citationCorrectness": 1, + "crossTenantLeaks": 0 + } + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "gate", + "frame": { + "jsonrpc": "2.0", + "id": 5, + "method": "tools/call", + "params": { + "name": "gks_pipeline_gate", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "verdict": { + "verdict": "PASS", + "allowPublication": true + } + } + } + }, + { + "kind": "call", + "name": "publication", + "frame": { + "jsonrpc": "2.0", + "id": 6, + "method": "tools/call", + "params": { + "name": "gks_pipeline_publication_receipt", + "arguments": { + "receipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "decisionHash": { + "$bind": "claim.result.structuredContent.decisions.0.decisionHash" + }, + "snapshotId": "c0-evidence-snapshot", + "generation": "c0-evidence-generation", + "receiptHash": { + "$bind": "write.result.structuredContent.receiptHash" + }, + "publishedAt": "2026-09-07T15:00:03.000Z", + "pointerHash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "modelRevision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "transactionFrontier": "c0-evidence-final-frontier", + "readback": { + "ok": true + } + }, + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "worker-principal", + "role": "worker", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true, + "match": { + "accepted": true, + "idempotent": false + } + } + }, + { + "kind": "call", + "name": "evidence", + "frame": { + "jsonrpc": "2.0", + "id": 7, + "method": "tools/call", + "params": { + "name": "gks_pipeline_evidence", + "arguments": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "relayCredential": "c0-fixture-pipeline-relay", + "authenticatedPrincipal": { + "principalId": "source-principal", + "role": "source", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + } + } + } + } + }, + "expect": { + "ok": true + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/cases/C0.4-TRANSPORT-DENIAL.json b/tests/fixtures/c0-qualification/cases/C0.4-TRANSPORT-DENIAL.json new file mode 100644 index 0000000..73aa778 --- /dev/null +++ b/tests/fixtures/c0-qualification/cases/C0.4-TRANSPORT-DENIAL.json @@ -0,0 +1,137 @@ +{ + "id": "C0.4-TRANSPORT-DENIAL", + "fixtureVersion": "c0-qualification/v2", + "env": { + "GKS_DEFAULT_PORTFOLIO_ID": "c0-portfolio", + "GKS_PIPELINE_RELAY_CREDENTIAL": "c0-fixture-pipeline-relay" + }, + "secrets": [ + "c0-fixture-pipeline-relay" + ], + "steps": [ + { + "kind": "raw", + "parts": [ + { + "text": "{not json\n" + } + ], + "expect": { + "protocolError": true + } + }, + { + "kind": "raw", + "parts": [ + { + "text": "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"method\":\"tools/list\"}\n" + } + ], + "expect": { + "protocolError": true + } + }, + { + "kind": "raw", + "parts": [ + { + "text": "[{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"initialize\"}]\n" + } + ], + "expect": { + "protocolError": true, + "errorMessage": "JSON-RPC batch requests are unsupported." + } + }, + { + "kind": "raw", + "parts": [ + { + "text": "{\"jsonrpc\":\"2.0\",\"id\":3,\"method\":\"tools/call\",\"params\":{\"name\":\"gks_health\",\"arguments\":[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}}\n" + } + ], + "expect": { + "protocolError": true, + "errorMessage": "JSON depth exceeds the configured limit." + } + }, + { + "kind": "raw", + "parts": [ + { + "text": "{\"jsonrpc\":\"2.0\",\"id\":4,\"method\":\"tools/call\",\"params\":{\"name\":\"gks_health\",\"arguments\":{\"padding\":\"" + }, + { + "repeat": "x", + "count": 1048576 + }, + { + "text": "\"}}}\n" + } + ], + "expect": { + "protocolError": true, + "errorMessage": "Request frame exceeds the configured limit." + } + }, + { + "kind": "raw", + "parts": [ + { + "text": "{\"jsonrpc\":\"2.0\",\"id\":5,\"method\":\"tools/list\",\"params\":{\"x\":\"" + }, + { + "base64": "wyg=" + }, + { + "text": "\"}}\n" + } + ], + "expect": { + "protocolError": true + } + }, + { + "kind": "raw", + "parts": [ + { + "text": "{\"jsonrpc\":\"2.0\",\"id\":6,\"method\":\"tools/list\",\"params\":{\"x\":1e400}}\n" + } + ], + "expect": { + "protocolError": true + } + }, + { + "kind": "store-query", + "sql": "SELECT COUNT(*) AS promotions FROM promotions", + "params": [], + "expect": { + "rows": [ + { + "promotions": 0 + } + ] + } + }, + { + "kind": "call", + "name": "alive", + "frame": { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "gks_health", + "arguments": {} + } + }, + "expect": { + "ok": true, + "match": { + "state": "ready" + } + } + } + ] +} diff --git a/tests/fixtures/c0-qualification/expected/C0.4-API010-REPLAY.json b/tests/fixtures/c0-qualification/expected/C0.4-API010-REPLAY.json new file mode 100644 index 0000000..cc91f9e --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-API010-REPLAY.json @@ -0,0 +1,136 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_21a2568dd572cbcb2da6e8e4c096b14e", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "restart" + }, + { + "step": 3, + "kind": "call", + "name": "replay", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_21a2568dd572cbcb2da6e8e4c096b14e", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": true, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "conflict", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "idempotency_key is already bound to a different source_snapshot_hash." + } + ], + "structuredContent": { + "code": "gks_conflict", + "message": "idempotency_key is already bound to a different source_snapshot_hash." + } + } + } + }, + { + "step": 5, + "kind": "store-query", + "rows": [ + { + "promotions": 1 + } + ] + }, + { + "step": 6, + "kind": "store-query", + "rows": [ + { + "evidence": 1 + } + ] + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-AUTH-DENIAL.json b/tests/fixtures/c0-qualification/expected/C0.4-AUTH-DENIAL.json new file mode 100644 index 0000000..02562c7 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-AUTH-DENIAL.json @@ -0,0 +1,264 @@ +[ + { + "step": 1, + "kind": "call", + "name": "health", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "service": "gks", + "state": "ready", + "graphVersion": "gks:graph/0" + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "missing", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "Authenticated MSP transport is required." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "Authenticated MSP transport is required." + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "forgedCredential", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "Authenticated MSP transport is invalid." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "Authenticated MSP transport is invalid." + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "wrongRole", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "Authenticated MSP transport is required." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "Authenticated MSP transport is required." + } + } + } + }, + { + "step": 5, + "kind": "call", + "name": "staleVersion", + "response": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "Authenticated MSP transport is required." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "Authenticated MSP transport is required." + } + } + } + }, + { + "step": 6, + "kind": "call", + "name": "forgedScope", + "response": { + "jsonrpc": "2.0", + "id": 6, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "Authenticated MSP transport scope does not match the request." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "Authenticated MSP transport scope does not match the request." + } + } + } + }, + { + "step": 7, + "kind": "call", + "name": "searchUnauthenticated", + "response": { + "jsonrpc": "2.0", + "id": 7, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "Authenticated MSP transport is required." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "Authenticated MSP transport is required." + } + } + } + }, + { + "step": 8, + "kind": "store-query", + "rows": [ + { + "promotions": 0 + } + ] + }, + { + "step": 9, + "kind": "call", + "name": "accepted", + "response": { + "jsonrpc": "2.0", + "id": 8, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_a3c8adcb82a0dc1c939ee2c2d4d51ddf", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26d42e3a72a6f439112abfac3bcac347", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-688e9dac942868a6f47e0a65c3e37718", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 10, + "kind": "call", + "name": "search", + "response": { + "jsonrpc": "2.0", + "id": 9, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [ + { + "canonicalRef": "gks:entity/feat-line-linking-26d42e3a72a6f439112abfac3bcac347", + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity.", + "sourceRef": null, + "confidence": null, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "metadata": {}, + "aliases": [], + "externalRefs": [], + "normKey": "feat line linking", + "normVersion": "norm_v1", + "supersededBy": null, + "createdAt": "", + "updatedAt": "", + "graphVersion": "gks:graph/1" + } + ] + } + } + }, + { + "step": 11, + "kind": "store-query", + "rows": [ + { + "promotions": 1 + } + ] + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-BACKEND-FAILURE.json b/tests/fixtures/c0-qualification/expected/C0.4-BACKEND-FAILURE.json new file mode 100644 index 0000000..19b8878 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-BACKEND-FAILURE.json @@ -0,0 +1,113 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_ffdb333d7ed5ba7d3162fcc16b561f09", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "store-exec" + }, + { + "step": 3, + "kind": "call", + "name": "failed", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "no such table: stage_evidence" + } + ], + "structuredContent": { + "code": "gks_backend_unavailable", + "message": "no such table: stage_evidence" + } + } + } + }, + { + "step": 4, + "kind": "store-query", + "rows": [ + { + "entities": 0 + } + ] + }, + { + "step": 5, + "kind": "store-query", + "rows": [ + { + "promotions": 0 + } + ] + }, + { + "step": 6, + "kind": "call", + "name": "alive", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "service": "gks", + "state": "ready", + "graphVersion": "gks:graph/1" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-GENESISRAG17-RECEIPTS.json b/tests/fixtures/c0-qualification/expected/C0.4-GENESISRAG17-RECEIPTS.json new file mode 100644 index 0000000..7d5dfd0 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-GENESISRAG17-RECEIPTS.json @@ -0,0 +1,3374 @@ +[ + { + "step": 1, + "kind": "call", + "name": "submit", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-receipts", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "claim", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisions": [ + { + "batchId": "c0-receipts", + "chunks": [ + { + "chunkId": "c0-receipts-chunk-1", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "endOffset": 25, + "ordinal": 0, + "parsedArtifactId": "c0-receipts-parsed", + "startOffset": 0, + "text": "Alice works for Acme Ltd." + }, + { + "chunkId": "c0-receipts-chunk-2", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "endOffset": 48, + "ordinal": 1, + "parsedArtifactId": "c0-receipts-parsed", + "startOffset": 26, + "text": "Alice purchased Atlas." + }, + { + "chunkId": "c0-receipts-chunk-3", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "endOffset": 74, + "ordinal": 2, + "parsedArtifactId": "c0-receipts-parsed", + "startOffset": 49, + "text": "Bob works for Beacon Ltd." + }, + { + "chunkId": "c0-receipts-chunk-4", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "endOffset": 96, + "ordinal": 3, + "parsedArtifactId": "c0-receipts-parsed", + "startOffset": 75, + "text": "Bob purchased Nimbus." + }, + { + "chunkId": "c0-receipts-chunk-5", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "endOffset": 123, + "ordinal": 4, + "parsedArtifactId": "c0-receipts-parsed", + "startOffset": 97, + "text": "Carol works for Cedar Ltd." + } + ], + "decisionHash": "", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "derived": [], + "entities": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "mentions": [ + "c0-receipts-mention-1-1", + "c0-receipts-mention-2-1" + ], + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "name": "Alice", + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "mentions": [ + "c0-receipts-mention-1-2" + ], + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "name": "Acme Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "mentions": [ + "c0-receipts-mention-2-2" + ], + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "name": "Atlas", + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "mentions": [ + "c0-receipts-mention-3-1", + "c0-receipts-mention-4-1" + ], + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "name": "Bob", + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "mentions": [ + "c0-receipts-mention-3-2" + ], + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "name": "Beacon Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "mentions": [ + "c0-receipts-mention-4-2" + ], + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "name": "Nimbus", + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "mentions": [ + "c0-receipts-mention-5-1" + ], + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "name": "Carol", + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "mentions": [ + "c0-receipts-mention-5-2" + ], + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "name": "Cedar Ltd.", + "semanticType": "Organization" + } + ], + "expectedGraphReadback": { + "edgeCount": 26, + "nodeCount": 20 + }, + "facts": [ + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/eeba8f0efada21fa94d2d24eec2ba2f1", + "objectId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-1", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-1-1", + "c0-receipts-mention-1-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/f63d53517e6d62cd4414965d3359cc5f", + "objectId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-2", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-2-1", + "c0-receipts-mention-2-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/e6a2d08e04b70600539d327d387aa9d7", + "objectId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-3", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-3-1", + "c0-receipts-mention-3-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/4cf8ce864dffa7db338e0c77b16cc385", + "objectId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-4", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-4-1", + "c0-receipts-mention-4-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/cd334351844821396d08ea02ff64b8f6", + "objectId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-5", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-5-1", + "c0-receipts-mention-5-2" + ] + }, + "subjectId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + } + ], + "graph": { + "edges": [ + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/eeba8f0efada21fa94d2d24eec2ba2f1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-1", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-1-1", + "c0-receipts-mention-1-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef" + }, + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/f63d53517e6d62cd4414965d3359cc5f", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-2", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-2-1", + "c0-receipts-mention-2-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/e6a2d08e04b70600539d327d387aa9d7", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-3", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-3-1", + "c0-receipts-mention-3-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/4cf8ce864dffa7db338e0c77b16cc385", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-4", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-4-1", + "c0-receipts-mention-4-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637" + }, + { + "confidence": 0.9, + "from": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "id": "gks:fact/cd334351844821396d08ea02ff64b8f6", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-chunk-5", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-5-1", + "c0-receipts-mention-5-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/cedar-1580060aacced42afb786146c028fed1" + } + ], + "nodes": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "semanticType": "Organization" + } + ] + }, + "held": [], + "mentions": [ + { + "chunkId": "c0-receipts-chunk-1", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-mention-1-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-chunk-1", + "endOffset": 25, + "name": "Acme Ltd.", + "resolutionKey": "acme", + "semanticType": "Organization", + "sourceMentionId": "c0-receipts-mention-1-2", + "startOffset": 16 + }, + { + "chunkId": "c0-receipts-chunk-2", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-mention-2-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-chunk-2", + "endOffset": 21, + "name": "Atlas", + "resolutionKey": "atlas", + "semanticType": "Product", + "sourceMentionId": "c0-receipts-mention-2-2", + "startOffset": 16 + }, + { + "chunkId": "c0-receipts-chunk-3", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-mention-3-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-chunk-3", + "endOffset": 25, + "name": "Beacon Ltd.", + "resolutionKey": "beacon", + "semanticType": "Organization", + "sourceMentionId": "c0-receipts-mention-3-2", + "startOffset": 14 + }, + { + "chunkId": "c0-receipts-chunk-4", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-mention-4-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-chunk-4", + "endOffset": 20, + "name": "Nimbus", + "resolutionKey": "nimbus", + "semanticType": "Product", + "sourceMentionId": "c0-receipts-mention-4-2", + "startOffset": 14 + }, + { + "chunkId": "c0-receipts-chunk-5", + "endOffset": 5, + "name": "Carol", + "resolutionKey": "carol", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-mention-5-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-chunk-5", + "endOffset": 26, + "name": "Cedar Ltd.", + "resolutionKey": "cedar", + "semanticType": "Organization", + "sourceMentionId": "c0-receipts-mention-5-2", + "startOffset": 16 + } + ], + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "runId": "c0-receipts-run", + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "source": { + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd.", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "documentId": "c0-receipts-document", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "version": "1" + }, + "stageMetrics": { + "9": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0 + }, + "10": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "11": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "12": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "unmapped": 0 + }, + "13": { + "records_in": 13, + "records_out": 5, + "records_quarantined": 0 + }, + "14": { + "records_in": 8, + "records_out": 0, + "records_quarantined": 0 + } + }, + "stages": [ + { + "attemptId": "c0-receipts-attempt-9", + "executionStepId": "c0-receipts-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-attempt-10", + "executionStepId": "c0-receipts-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-attempt-11", + "executionStepId": "c0-receipts-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-attempt-12", + "executionStepId": "c0-receipts-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-receipts-attempt-13", + "executionStepId": "c0-receipts-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-attempt-14", + "executionStepId": "c0-receipts-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-attempt-15", + "executionStepId": "c0-receipts-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-attempt-16", + "executionStepId": "c0-receipts-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-attempt-17", + "executionStepId": "c0-receipts-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-run", + "stageNumber": 17 + } + ] + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "graph", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/e5ae478c0bb69dbba7bec9b5a89a0e5f", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-1", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-1-1", + "c0-receipts-mention-1-2" + ] + }, + { + "chunkId": "c0-receipts-chunk-2", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-2-1", + "c0-receipts-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/f9f93c92a801fd77f3a6eaad3cc288c6", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-1", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-1-1", + "c0-receipts-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/b520ad0fc63a57dadf4af7489daab5fa", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-2", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-2-1", + "c0-receipts-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/352d0e9b2b595d19fca5e803cb61b225", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-3", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-3-1", + "c0-receipts-mention-3-2" + ] + }, + { + "chunkId": "c0-receipts-chunk-4", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-4-1", + "c0-receipts-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/59eff557b6dafc9848a03b9f598c2b68", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-3", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-3-1", + "c0-receipts-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/d2fd45d900808ed23a06e2068b6223d6", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-4", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-4-1", + "c0-receipts-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/41cec0ffc5f6ab7fcaab932d8806b88f", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-5", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-5-1", + "c0-receipts-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/bd54501c0ed1642e5aa2731d7fcf5f9e", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-5", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-5-1", + "c0-receipts-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "graphReplay", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": true, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/e5ae478c0bb69dbba7bec9b5a89a0e5f", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-1", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-1-1", + "c0-receipts-mention-1-2" + ] + }, + { + "chunkId": "c0-receipts-chunk-2", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-2-1", + "c0-receipts-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/f9f93c92a801fd77f3a6eaad3cc288c6", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-1", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-1-1", + "c0-receipts-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/b520ad0fc63a57dadf4af7489daab5fa", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-2", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-2-1", + "c0-receipts-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/352d0e9b2b595d19fca5e803cb61b225", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-3", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-3-1", + "c0-receipts-mention-3-2" + ] + }, + { + "chunkId": "c0-receipts-chunk-4", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-4-1", + "c0-receipts-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/59eff557b6dafc9848a03b9f598c2b68", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-3", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-3-1", + "c0-receipts-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/d2fd45d900808ed23a06e2068b6223d6", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-4", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-4-1", + "c0-receipts-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/41cec0ffc5f6ab7fcaab932d8806b88f", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-5", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-5-1", + "c0-receipts-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/bd54501c0ed1642e5aa2731d7fcf5f9e", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-chunk-5", + "parsedArtifactId": "c0-receipts-parsed", + "rawArtifactId": "c0-receipts-raw", + "sourceId": "c0-receipts-source", + "sourceMentionIds": [ + "c0-receipts-mention-5-1", + "c0-receipts-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + }, + { + "step": 5, + "kind": "call", + "name": "wrongHash", + "response": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "decision already has a different graph receipt." + } + ], + "structuredContent": { + "code": "gks_conflict", + "message": "decision already has a different graph receipt." + } + } + } + }, + { + "step": 6, + "kind": "call", + "name": "wrongScope", + "response": { + "jsonrpc": "2.0", + "id": 6, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "Authenticated MSP principal scope does not match the request." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "Authenticated MSP principal scope does not match the request." + } + } + } + }, + { + "step": 7, + "kind": "call", + "name": "wrongStage", + "response": { + "jsonrpc": "2.0", + "id": 7, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "decision already has a different graph receipt." + } + ], + "structuredContent": { + "code": "gks_conflict", + "message": "decision already has a different graph receipt." + } + } + } + }, + { + "step": 8, + "kind": "call", + "name": "sourceRole", + "response": { + "jsonrpc": "2.0", + "id": 8, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "Authenticated MSP principal role is not permitted." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "Authenticated MSP principal role is not permitted." + } + } + } + }, + { + "step": 9, + "kind": "call", + "name": "write", + "response": { + "jsonrpc": "2.0", + "id": 9, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "receiptHash": "" + } + } + } + }, + { + "step": 10, + "kind": "call", + "name": "gate", + "response": { + "jsonrpc": "2.0", + "id": 10, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "verdict": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": "", + "snapshotId": "c0-receipts-snapshot", + "generation": "c0-receipts-generation", + "receiptHash": "", + "verdict": "PASS", + "allowPublication": true, + "dimensions": { + "data": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "graph": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "knowledge": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "security": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "retrieval": { + "result": "PASS", + "critical": false, + "reasons": [] + } + }, + "statistics": { + "documents": 1, + "chunks": 5, + "entities": 8, + "facts": 5, + "relations": 5 + }, + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1" + }, + "verdictHash": "" + } + } + } + }, + { + "step": 11, + "kind": "call", + "name": "publication", + "response": { + "jsonrpc": "2.0", + "id": 11, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "publicationHash": "" + } + } + } + }, + { + "step": 12, + "kind": "call", + "name": "evidence", + "response": { + "jsonrpc": "2.0", + "id": 12, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "rows": [ + { + "cursor": 1, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "executionStepId": "c0-receipts-step-9", + "attemptId": "c0-receipts-attempt-9", + "stageNumber": 9, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-receipts", + "decisionHash": "", + "stageNumber": 9, + "records": 8 + } + }, + { + "cursor": 2, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "executionStepId": "c0-receipts-step-10", + "attemptId": "c0-receipts-attempt-10", + "stageNumber": 10, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-receipts", + "decisionHash": "", + "stageNumber": 10, + "records": 5 + } + }, + { + "cursor": 3, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "executionStepId": "c0-receipts-step-11", + "attemptId": "c0-receipts-attempt-11", + "stageNumber": 11, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-receipts", + "decisionHash": "", + "stageNumber": 11, + "records": 5 + } + }, + { + "cursor": 4, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "executionStepId": "c0-receipts-step-12", + "attemptId": "c0-receipts-attempt-12", + "stageNumber": 12, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-receipts", + "decisionHash": "", + "stageNumber": 12, + "records": 5 + } + }, + { + "cursor": 5, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "executionStepId": "c0-receipts-step-13", + "attemptId": "c0-receipts-attempt-13", + "stageNumber": 13, + "outcome": "SUCCEEDED", + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z", + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "graphReceiptHash": "", + "nodeCount": 20, + "edgeCount": 26 + } + }, + { + "cursor": 6, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "pipelineStageId": "DPS-KI-ENRICH", + "executionStepId": "c0-receipts-step-14", + "attemptId": "c0-receipts-attempt-14", + "stageNumber": 14, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 8, + "records_out": 8, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "derivedHash": "", + "derivedCount": 8, + "documentCount": 8, + "chunkCount": 10, + "factCount": 10 + } + }, + { + "cursor": 7, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "pipelineStageId": "DPS-KI-EMBED", + "executionStepId": "c0-receipts-step-15", + "attemptId": "c0-receipts-attempt-15", + "stageNumber": 15, + "outcome": "SUCCEEDED", + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "receiptHash": "", + "stageNumber": 15, + "readback": { + "ok": true, + "nodeCount": 28, + "edgeCount": 44, + "vectorCount": 5, + "citationCount": 5 + }, + "laneStatuses": { + "vector": "ready", + "lexical": "ready", + "graph": "ready", + "sqlite": "ready", + "bitemporal": "not_applicable", + "provenance": "ready" + } + } + }, + { + "cursor": 8, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "pipelineStageId": "DPS-KI-INDEX", + "executionStepId": "c0-receipts-step-16", + "attemptId": "c0-receipts-attempt-16", + "stageNumber": 16, + "outcome": "SUCCEEDED", + "startedAt": "2026-09-07T15:00:02.000Z", + "finishedAt": "2026-09-07T15:00:02.100Z", + "metrics": { + "records_in": 72, + "records_out": 72, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "receiptHash": "", + "stageNumber": 16, + "readback": { + "ok": true, + "nodeCount": 28, + "edgeCount": 44, + "vectorCount": 5, + "citationCount": 5 + }, + "laneStatuses": { + "vector": "ready", + "lexical": "ready", + "graph": "ready", + "sqlite": "ready", + "bitemporal": "not_applicable", + "provenance": "ready" + } + } + }, + { + "cursor": 9, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "executionStepId": "c0-receipts-step-17", + "attemptId": "c0-receipts-attempt-17", + "stageNumber": 17, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 26, + "records_out": 1, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "verdict": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": "", + "snapshotId": "c0-receipts-snapshot", + "generation": "c0-receipts-generation", + "receiptHash": "", + "verdict": "PASS", + "allowPublication": true, + "dimensions": { + "data": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "graph": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "knowledge": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "security": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "retrieval": { + "result": "PASS", + "critical": false, + "reasons": [] + } + }, + "statistics": { + "documents": 1, + "chunks": 5, + "entities": 8, + "facts": 5, + "relations": 5 + }, + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "metrics": { + "records_in": 26, + "records_out": 1, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "gateStartedAt": "", + "gateFinishedAt": "" + }, + "publicationReceipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-run", + "decisionId": "gks:decision/6e926d7e268601344f53ebede006907c", + "decisionHash": "", + "snapshotId": "c0-receipts-snapshot", + "generation": "c0-receipts-generation", + "receiptHash": "", + "publishedAt": "2026-09-07T15:00:03.000Z", + "pointerHash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "modelRevision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "transactionFrontier": "c0-receipts-final-frontier", + "readback": { + "ok": true + } + } + } + } + ], + "nextCursor": 9 + } + } + } + }, + { + "step": 13, + "kind": "call", + "name": "failed-submit", + "response": { + "jsonrpc": "2.0", + "id": 13, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-receipts-failed", + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 14, + "kind": "call", + "name": "failed-claim", + "response": { + "jsonrpc": "2.0", + "id": 14, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisions": [ + { + "batchId": "c0-receipts-failed", + "chunks": [ + { + "chunkId": "c0-receipts-failed-chunk-1", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "endOffset": 25, + "ordinal": 0, + "parsedArtifactId": "c0-receipts-failed-parsed", + "startOffset": 0, + "text": "Alice works for Acme Ltd." + }, + { + "chunkId": "c0-receipts-failed-chunk-2", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "endOffset": 48, + "ordinal": 1, + "parsedArtifactId": "c0-receipts-failed-parsed", + "startOffset": 26, + "text": "Alice purchased Atlas." + }, + { + "chunkId": "c0-receipts-failed-chunk-3", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "endOffset": 74, + "ordinal": 2, + "parsedArtifactId": "c0-receipts-failed-parsed", + "startOffset": 49, + "text": "Bob works for Beacon Ltd." + }, + { + "chunkId": "c0-receipts-failed-chunk-4", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "endOffset": 96, + "ordinal": 3, + "parsedArtifactId": "c0-receipts-failed-parsed", + "startOffset": 75, + "text": "Bob purchased Nimbus." + }, + { + "chunkId": "c0-receipts-failed-chunk-5", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "endOffset": 123, + "ordinal": 4, + "parsedArtifactId": "c0-receipts-failed-parsed", + "startOffset": 97, + "text": "Carol works for Cedar Ltd." + } + ], + "decisionHash": "", + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d", + "derived": [], + "entities": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "mentions": [ + "c0-receipts-failed-mention-1-1", + "c0-receipts-failed-mention-2-1" + ], + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "name": "Alice", + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "mentions": [ + "c0-receipts-failed-mention-1-2" + ], + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "name": "Acme Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "mentions": [ + "c0-receipts-failed-mention-2-2" + ], + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "name": "Atlas", + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "mentions": [ + "c0-receipts-failed-mention-3-1", + "c0-receipts-failed-mention-4-1" + ], + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "name": "Bob", + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "mentions": [ + "c0-receipts-failed-mention-3-2" + ], + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "name": "Beacon Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "mentions": [ + "c0-receipts-failed-mention-4-2" + ], + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "name": "Nimbus", + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "mentions": [ + "c0-receipts-failed-mention-5-1" + ], + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "name": "Carol", + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "mentions": [ + "c0-receipts-failed-mention-5-2" + ], + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "name": "Cedar Ltd.", + "semanticType": "Organization" + } + ], + "expectedGraphReadback": { + "edgeCount": 26, + "nodeCount": 20 + }, + "facts": [ + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/fc8557067f43ee8f8833a415a4ce4d65", + "objectId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-1", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-1-1", + "c0-receipts-failed-mention-1-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/b659730b31688f9a49f03625b2aed89c", + "objectId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-2", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-2-1", + "c0-receipts-failed-mention-2-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/b3859e9508e7dc3b406f17b7e006b9dc", + "objectId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-3", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-3-1", + "c0-receipts-failed-mention-3-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/f5d1d7650fd5c654c3294bb4f8909121", + "objectId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-4", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-4-1", + "c0-receipts-failed-mention-4-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/8c084ce38b67fc4e6c57fe2b27b0f508", + "objectId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-5", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-5-1", + "c0-receipts-failed-mention-5-2" + ] + }, + "subjectId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + } + ], + "graph": { + "edges": [ + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/fc8557067f43ee8f8833a415a4ce4d65", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-1", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-1-1", + "c0-receipts-failed-mention-1-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef" + }, + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/b659730b31688f9a49f03625b2aed89c", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-2", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-2-1", + "c0-receipts-failed-mention-2-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/b3859e9508e7dc3b406f17b7e006b9dc", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-3", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-3-1", + "c0-receipts-failed-mention-3-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/f5d1d7650fd5c654c3294bb4f8909121", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-4", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-4-1", + "c0-receipts-failed-mention-4-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637" + }, + { + "confidence": 0.9, + "from": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "id": "gks:fact/8c084ce38b67fc4e6c57fe2b27b0f508", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-receipts-failed-chunk-5", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-5-1", + "c0-receipts-failed-mention-5-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/cedar-1580060aacced42afb786146c028fed1" + } + ], + "nodes": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "semanticType": "Organization" + } + ] + }, + "held": [], + "mentions": [ + { + "chunkId": "c0-receipts-failed-chunk-1", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-failed-mention-1-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-failed-chunk-1", + "endOffset": 25, + "name": "Acme Ltd.", + "resolutionKey": "acme", + "semanticType": "Organization", + "sourceMentionId": "c0-receipts-failed-mention-1-2", + "startOffset": 16 + }, + { + "chunkId": "c0-receipts-failed-chunk-2", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-failed-mention-2-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-failed-chunk-2", + "endOffset": 21, + "name": "Atlas", + "resolutionKey": "atlas", + "semanticType": "Product", + "sourceMentionId": "c0-receipts-failed-mention-2-2", + "startOffset": 16 + }, + { + "chunkId": "c0-receipts-failed-chunk-3", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-failed-mention-3-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-failed-chunk-3", + "endOffset": 25, + "name": "Beacon Ltd.", + "resolutionKey": "beacon", + "semanticType": "Organization", + "sourceMentionId": "c0-receipts-failed-mention-3-2", + "startOffset": 14 + }, + { + "chunkId": "c0-receipts-failed-chunk-4", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-failed-mention-4-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-failed-chunk-4", + "endOffset": 20, + "name": "Nimbus", + "resolutionKey": "nimbus", + "semanticType": "Product", + "sourceMentionId": "c0-receipts-failed-mention-4-2", + "startOffset": 14 + }, + { + "chunkId": "c0-receipts-failed-chunk-5", + "endOffset": 5, + "name": "Carol", + "resolutionKey": "carol", + "semanticType": "Person", + "sourceMentionId": "c0-receipts-failed-mention-5-1", + "startOffset": 0 + }, + { + "chunkId": "c0-receipts-failed-chunk-5", + "endOffset": 26, + "name": "Cedar Ltd.", + "resolutionKey": "cedar", + "semanticType": "Organization", + "sourceMentionId": "c0-receipts-failed-mention-5-2", + "startOffset": 16 + } + ], + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "runId": "c0-receipts-failed-run", + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "source": { + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd.", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "documentId": "c0-receipts-failed-document", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "version": "1" + }, + "stageMetrics": { + "9": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0 + }, + "10": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "11": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "12": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "unmapped": 0 + }, + "13": { + "records_in": 13, + "records_out": 5, + "records_quarantined": 0 + }, + "14": { + "records_in": 8, + "records_out": 0, + "records_quarantined": 0 + } + }, + "stages": [ + { + "attemptId": "c0-receipts-failed-attempt-9", + "executionStepId": "c0-receipts-failed-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-receipts-failed-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-receipts-failed-attempt-10", + "executionStepId": "c0-receipts-failed-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-receipts-failed-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-receipts-failed-attempt-11", + "executionStepId": "c0-receipts-failed-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-receipts-failed-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-receipts-failed-attempt-12", + "executionStepId": "c0-receipts-failed-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-receipts-failed-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-receipts-failed-attempt-13", + "executionStepId": "c0-receipts-failed-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-receipts-failed-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-receipts-failed-attempt-14", + "executionStepId": "c0-receipts-failed-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-receipts-failed-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-receipts-failed-attempt-15", + "executionStepId": "c0-receipts-failed-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-failed-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-receipts-failed-attempt-16", + "executionStepId": "c0-receipts-failed-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-receipts-failed-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-receipts-failed-attempt-17", + "executionStepId": "c0-receipts-failed-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-receipts-failed-run", + "stageNumber": 17 + } + ] + } + ] + } + } + } + }, + { + "step": 15, + "kind": "call", + "name": "failed-graph", + "response": { + "jsonrpc": "2.0", + "id": 15, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/33fc6809ccdac66dfef0607e434473c9", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-receipts-failed-chunk-1", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-1-1", + "c0-receipts-failed-mention-1-2" + ] + }, + { + "chunkId": "c0-receipts-failed-chunk-2", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-2-1", + "c0-receipts-failed-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/5b8a72b6e8a7ce5aace0965cf17408e1", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-failed-chunk-1", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-1-1", + "c0-receipts-failed-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/bde21b9a55aefd4b48695e21ce81e511", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-failed-chunk-2", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-2-1", + "c0-receipts-failed-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/8529dc364123c022f09569afdb7ab9b2", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-receipts-failed-chunk-3", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-3-1", + "c0-receipts-failed-mention-3-2" + ] + }, + { + "chunkId": "c0-receipts-failed-chunk-4", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-4-1", + "c0-receipts-failed-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/eb9dae6b957ba08531528c81c5fee87d", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-failed-chunk-3", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-3-1", + "c0-receipts-failed-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/8d6dab66a1dbf66c52ca57aabfefb5c2", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-failed-chunk-4", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-4-1", + "c0-receipts-failed-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/a2d7221e16d3802209fcac8d7eb8d1d2", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-failed-chunk-5", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-5-1", + "c0-receipts-failed-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/1028b0d39996d75fc2673e34271babd8", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-receipts-failed-chunk-5", + "parsedArtifactId": "c0-receipts-failed-parsed", + "rawArtifactId": "c0-receipts-failed-raw", + "sourceId": "c0-receipts-failed-source", + "sourceMentionIds": [ + "c0-receipts-failed-mention-5-1", + "c0-receipts-failed-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + }, + { + "step": 16, + "kind": "call", + "name": "failure", + "response": { + "jsonrpc": "2.0", + "id": 16, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "stage": { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-receipts-failed-run", + "executionStepId": "c0-receipts-failed-step-15", + "attemptId": "c0-receipts-failed-attempt-15" + }, + "failureHash": "" + } + } + } + }, + { + "step": 17, + "kind": "call", + "name": "gateAfterFailure", + "response": { + "jsonrpc": "2.0", + "id": 17, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "verdict": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d", + "decisionHash": "", + "snapshotId": "", + "generation": "", + "receiptHash": null, + "verdict": "FAIL", + "allowPublication": false, + "dimensions": { + "data": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "graph": { + "result": "FAIL", + "critical": true, + "reasons": [ + "actual Tier4 final worker receipt is missing." + ] + }, + "knowledge": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "security": { + "result": "FAIL", + "critical": true, + "reasons": [ + "retrieval benchmark reported a cross-tenant leak." + ] + }, + "retrieval": { + "result": "FAIL", + "critical": true, + "reasons": [ + "retrieval benchmark is missing." + ] + } + }, + "statistics": { + "documents": 1, + "chunks": 5, + "entities": 8, + "facts": 5, + "relations": 5 + }, + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1" + }, + "verdictHash": "" + } + } + } + }, + { + "step": 18, + "kind": "call", + "name": "failedEvidence", + "response": { + "jsonrpc": "2.0", + "id": 18, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "rows": [ + { + "cursor": 10, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "executionStepId": "c0-receipts-failed-step-9", + "attemptId": "c0-receipts-failed-attempt-9", + "stageNumber": 9, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-receipts-failed", + "decisionHash": "", + "stageNumber": 9, + "records": 8 + } + }, + { + "cursor": 11, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "executionStepId": "c0-receipts-failed-step-10", + "attemptId": "c0-receipts-failed-attempt-10", + "stageNumber": 10, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-receipts-failed", + "decisionHash": "", + "stageNumber": 10, + "records": 5 + } + }, + { + "cursor": 12, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "executionStepId": "c0-receipts-failed-step-11", + "attemptId": "c0-receipts-failed-attempt-11", + "stageNumber": 11, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-receipts-failed", + "decisionHash": "", + "stageNumber": 11, + "records": 5 + } + }, + { + "cursor": 13, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "executionStepId": "c0-receipts-failed-step-12", + "attemptId": "c0-receipts-failed-attempt-12", + "stageNumber": 12, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-receipts-failed", + "decisionHash": "", + "stageNumber": 12, + "records": 5 + } + }, + { + "cursor": 14, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "executionStepId": "c0-receipts-failed-step-13", + "attemptId": "c0-receipts-failed-attempt-13", + "stageNumber": 13, + "outcome": "SUCCEEDED", + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z", + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d", + "graphReceiptHash": "", + "nodeCount": 20, + "edgeCount": 26 + } + }, + { + "cursor": 15, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "pipelineStageId": "DPS-KI-ENRICH", + "executionStepId": "c0-receipts-failed-step-14", + "attemptId": "c0-receipts-failed-attempt-14", + "stageNumber": 14, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 8, + "records_out": 8, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d", + "derivedHash": "", + "derivedCount": 8, + "documentCount": 8, + "chunkCount": 10, + "factCount": 10 + } + }, + { + "cursor": 16, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "pipelineStageId": "DPS-KI-EMBED", + "executionStepId": "c0-receipts-failed-step-15", + "attemptId": "c0-receipts-failed-attempt-15", + "stageNumber": 15, + "outcome": "FAILED", + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z", + "metrics": { + "records_in": 1, + "records_out": 1, + "records_quarantined": 0, + "error_count": 1, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "failureHash": "", + "error": { + "code": "INDEX_WRITE_FAILED", + "message": "C0 fixture index write failure" + } + } + }, + { + "cursor": 17, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "executionStepId": "c0-receipts-failed-step-17", + "attemptId": "c0-receipts-failed-attempt-17", + "stageNumber": 17, + "outcome": "FAILED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 26, + "records_out": 0, + "records_quarantined": 0, + "error_count": 1, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "verdict": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-receipts-failed-run", + "decisionId": "gks:decision/c09918ecbfcf5bf0f6d1e8ea4946899d", + "decisionHash": "", + "snapshotId": "", + "generation": "", + "receiptHash": null, + "verdict": "FAIL", + "allowPublication": false, + "dimensions": { + "data": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "graph": { + "result": "FAIL", + "critical": true, + "reasons": [ + "actual Tier4 final worker receipt is missing." + ] + }, + "knowledge": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "security": { + "result": "FAIL", + "critical": true, + "reasons": [ + "retrieval benchmark reported a cross-tenant leak." + ] + }, + "retrieval": { + "result": "FAIL", + "critical": true, + "reasons": [ + "retrieval benchmark is missing." + ] + } + }, + "statistics": { + "documents": 1, + "chunks": 5, + "entities": 8, + "facts": 5, + "relations": 5 + }, + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "metrics": { + "records_in": 26, + "records_out": 0, + "records_quarantined": 0, + "error_count": 1, + "retry_count": 0, + "duration_ms": "" + }, + "gateStartedAt": "", + "gateFinishedAt": "" + }, + "publicationReceipt": null + } + } + ], + "nextCursor": 17 + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-LOST-RESPONSE-REPLAY.json b/tests/fixtures/c0-qualification/expected/C0.4-LOST-RESPONSE-REPLAY.json new file mode 100644 index 0000000..ce96cc2 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-LOST-RESPONSE-REPLAY.json @@ -0,0 +1,135 @@ +[ + { + "step": 1, + "kind": "kill-after-commit", + "committed": { + "knowledge_ref": "gks:knowledge/gks_knowledge_334e064a3e049c62b61b524b2fd03d1d", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + }, + { + "step": 2, + "kind": "restart" + }, + { + "step": 3, + "kind": "call", + "name": "replay", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_334e064a3e049c62b61b524b2fd03d1d", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": true, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "conflict", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "idempotency_key is already bound to a different source_snapshot_hash." + } + ], + "structuredContent": { + "code": "gks_conflict", + "message": "idempotency_key is already bound to a different source_snapshot_hash." + } + } + } + }, + { + "step": 5, + "kind": "kill-after-commit", + "committed": { + "batch_id": "c0-lost-submit", + "decision_id": "gks:decision/475cb6f3dd6065cbc1d80aa582bfa966" + } + }, + { + "step": 6, + "kind": "restart" + }, + { + "step": 7, + "kind": "call", + "name": "submitReplay", + "response": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-lost-submit", + "decisionId": "gks:decision/475cb6f3dd6065cbc1d80aa582bfa966", + "status": "PENDING", + "idempotent": true + } + } + } + }, + { + "step": 8, + "kind": "store-query", + "rows": [ + { + "promotions": 1, + "batches": 1 + } + ] + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TENANT-WALL.json b/tests/fixtures/c0-qualification/expected/C0.4-TENANT-WALL.json new file mode 100644 index 0000000..c0f33fe --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TENANT-WALL.json @@ -0,0 +1,284 @@ +[ + { + "step": 1, + "kind": "call", + "name": "tenant", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_3c20d4375703e21947ce46720213ff15", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "tenantless", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_5c589adb326f028730787cb77da084cd", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/2", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26d42e3a72a6f439112abfac3bcac347", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-688e9dac942868a6f47e0a65c3e37718", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "searchTenant", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [ + { + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity.", + "sourceRef": null, + "confidence": null, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "metadata": {}, + "aliases": [], + "externalRefs": [], + "normKey": "feat line linking", + "normVersion": "norm_v1", + "supersededBy": null, + "createdAt": "", + "updatedAt": "", + "graphVersion": "gks:graph/1" + } + ] + } + } + }, + { + "step": 4, + "kind": "call", + "name": "searchTenantless", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [ + { + "canonicalRef": "gks:entity/feat-line-linking-26d42e3a72a6f439112abfac3bcac347", + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity.", + "sourceRef": null, + "confidence": null, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "metadata": {}, + "aliases": [], + "externalRefs": [], + "normKey": "feat line linking", + "normVersion": "norm_v1", + "supersededBy": null, + "createdAt": "", + "updatedAt": "", + "graphVersion": "gks:graph/2" + } + ] + } + } + }, + { + "step": 5, + "kind": "call", + "name": "searchOther", + "response": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [] + } + } + }, + { + "step": 6, + "kind": "call", + "name": "searchShared", + "response": { + "jsonrpc": "2.0", + "id": 6, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [] + } + } + }, + { + "step": 7, + "kind": "call", + "name": "crossIntoTenantless", + "response": { + "jsonrpc": "2.0", + "id": 7, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "GKS scope denied." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "GKS scope denied." + } + } + } + }, + { + "step": 8, + "kind": "call", + "name": "crossIntoTenant", + "response": { + "jsonrpc": "2.0", + "id": 8, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "GKS scope denied." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "GKS scope denied." + } + } + } + }, + { + "step": 9, + "kind": "call", + "name": "crossFromOther", + "response": { + "jsonrpc": "2.0", + "id": 9, + "result": { + "isError": true, + "content": [ + { + "type": "text", + "text": "GKS scope denied." + } + ], + "structuredContent": { + "code": "gks_scope_denied", + "message": "GKS scope denied." + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-001.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-001.json new file mode 100644 index 0000000..c1d93ca --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-001.json @@ -0,0 +1,659 @@ +[ + { + "step": 1, + "kind": "call", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "protocolVersion": "2024-11-05", + "capabilities": { + "tools": {} + }, + "serverInfo": { + "name": "gks-knowledge-graph-service", + "version": "0.1.0" + } + } + } + }, + { + "step": 2, + "kind": "call", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "tools": [ + { + "name": "gks_health", + "description": "Reports GKS Knowledge Graph Service health.", + "inputSchema": { + "type": "object", + "additionalProperties": false + } + }, + { + "name": "gks_knowledge_promote", + "description": "Promotes one MSP-authorized knowledge candidate.", + "inputSchema": { + "type": "object", + "properties": { + "schema_version": { + "type": "string", + "const": "govibe-knowledge-candidate/v1" + }, + "idempotency_key": { + "type": "string", + "minLength": 1 + }, + "run_id": { + "type": "string", + "minLength": 1 + }, + "stage": { + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "source_snapshot_hash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "provenance_ref": { + "type": "string", + "pattern": "^msp:proof/" + }, + "candidate": { + "type": "object" + }, + "scope": { + "type": "object" + }, + "pipeline_stage_id": { + "type": "string", + "pattern": "^DPS-KI-[A-Z0-9]+(-[A-Z0-9]+)*$" + } + }, + "required": [ + "schema_version", + "idempotency_key", + "run_id", + "stage", + "source_snapshot_hash", + "provenance_ref", + "candidate" + ], + "additionalProperties": true + } + }, + { + "name": "gks_search", + "description": "Searches canonical knowledge within scope.", + "inputSchema": { + "type": "object", + "required": [ + "query", + "scope" + ] + } + }, + { + "name": "gks_entity_get", + "description": "Gets one canonical entity within scope.", + "inputSchema": { + "type": "object", + "required": [ + "ref", + "scope" + ] + } + }, + { + "name": "gks_relations_get", + "description": "Gets canonical relations within scope.", + "inputSchema": { + "type": "object", + "required": [ + "ref", + "scope" + ] + } + }, + { + "name": "gks_artifact_link", + "description": "Links an external artifact reference to canonical knowledge.", + "inputSchema": { + "type": "object", + "required": [ + "knowledgeRef", + "artifactRef", + "relationType", + "evidenceRef", + "scope" + ] + } + }, + { + "name": "gks_review_list", + "description": "Lists unresolved entity mentions (REVIEW_REQUIRED / AMBIGUOUS) within scope.", + "inputSchema": { + "type": "object", + "required": [ + "scope" + ] + } + }, + { + "name": "gks_review_apply", + "description": "Applies one human resolution decision: bind an unresolved mention to a canonical entity, or merge two canonical entities.", + "inputSchema": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "BIND", + "MERGE" + ] + }, + "provenanceRef": { + "type": "string", + "pattern": "^msp:proof/" + }, + "scope": { + "type": "object" + }, + "mentionId": { + "type": "string", + "pattern": "^gks:mention/[a-f0-9]{32}$" + }, + "canonicalRef": { + "type": "string", + "pattern": "^gks:entity/[a-z0-9-]+-[a-f0-9]{32}$" + }, + "survivorRef": { + "type": "string", + "pattern": "^gks:entity/[a-z0-9-]+-[a-f0-9]{32}$" + }, + "supersededRef": { + "type": "string", + "pattern": "^gks:entity/[a-z0-9-]+-[a-f0-9]{32}$" + } + }, + "required": [ + "action", + "provenanceRef", + "scope" + ], + "additionalProperties": true + } + }, + { + "name": "gks_stage_evidence_export", + "description": "Exports append-only Tier-3 stage evidence rows (one per stage execution, NFR-020 metrics, per-record entries where the catalog is per-record) within scope, cursor-paginated and replay-safe.", + "inputSchema": { + "type": "object", + "properties": { + "scope": { + "type": "object" + }, + "since_cursor": { + "type": "integer", + "minimum": 0 + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 500 + } + }, + "required": [ + "scope" + ], + "additionalProperties": false + } + }, + { + "name": "gks_pipeline_submit", + "description": "Validates and durably accepts one GenesisRAG17 source batch for stages 9 through 17.", + "inputSchema": { + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "const": "genesisrag17.v1" + }, + "scope": { + "type": "object", + "required": [ + "portfolioId", + "tenantId", + "businessId", + "workspaceId", + "agentId", + "visibility" + ] + }, + "relayCredential": { + "type": "string", + "minLength": 1 + }, + "authenticatedPrincipal": { + "type": "object", + "required": [ + "principalId", + "role", + "scope" + ] + }, + "batch": { + "type": "object" + } + }, + "required": [ + "schemaVersion", + "scope", + "relayCredential", + "authenticatedPrincipal", + "batch" + ], + "additionalProperties": true + } + }, + { + "name": "gks_pipeline_claim", + "description": "Claims one pending GenesisRAG17 decision without destructive dequeue.", + "inputSchema": { + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "const": "genesisrag17.v1" + }, + "scope": { + "type": "object", + "required": [ + "portfolioId", + "tenantId", + "businessId", + "workspaceId", + "agentId", + "visibility" + ] + }, + "relayCredential": { + "type": "string", + "minLength": 1 + }, + "authenticatedPrincipal": { + "type": "object", + "required": [ + "principalId", + "role", + "scope" + ] + }, + "limit": { + "type": "integer", + "const": 1 + } + }, + "required": [ + "schemaVersion", + "scope", + "relayCredential", + "authenticatedPrincipal" + ], + "additionalProperties": true + } + }, + { + "name": "gks_pipeline_graph_receipt", + "description": "Records the authenticated Tier4 graph receipt, then authorizes actual GKS enrichment for stages 13 and 14.", + "inputSchema": { + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "const": "genesisrag17.v1" + }, + "scope": { + "type": "object", + "required": [ + "portfolioId", + "tenantId", + "businessId", + "workspaceId", + "agentId", + "visibility" + ] + }, + "relayCredential": { + "type": "string", + "minLength": 1 + }, + "authenticatedPrincipal": { + "type": "object", + "required": [ + "principalId", + "role", + "scope" + ] + }, + "receipt": { + "type": "object" + } + }, + "required": [ + "schemaVersion", + "scope", + "relayCredential", + "authenticatedPrincipal", + "receipt" + ], + "additionalProperties": true + } + }, + { + "name": "gks_pipeline_stage_failure", + "description": "Records one authenticated worker failure as the terminal evidence for its exact stage attempt.", + "inputSchema": { + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "const": "genesisrag17.v1" + }, + "scope": { + "type": "object", + "required": [ + "portfolioId", + "tenantId", + "businessId", + "workspaceId", + "agentId", + "visibility" + ] + }, + "relayCredential": { + "type": "string", + "minLength": 1 + }, + "authenticatedPrincipal": { + "type": "object", + "required": [ + "principalId", + "role", + "scope" + ] + }, + "runId": { + "type": "string", + "minLength": 1 + }, + "decisionId": { + "type": "string", + "minLength": 1 + }, + "decisionHash": { + "type": "string" + }, + "stage": { + "type": "object" + }, + "startedAt": { + "type": "string", + "minLength": 1 + }, + "finishedAt": { + "type": "string", + "minLength": 1 + }, + "metrics": { + "type": "object" + }, + "error": { + "type": "object" + } + }, + "required": [ + "schemaVersion", + "scope", + "relayCredential", + "authenticatedPrincipal", + "runId", + "decisionId", + "decisionHash", + "stage", + "startedAt", + "finishedAt", + "metrics", + "error" + ], + "additionalProperties": true + } + }, + { + "name": "gks_pipeline_write_receipt", + "description": "Records an authenticated Tier4 worker receipt for stages 13, 15, and 16.", + "inputSchema": { + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "const": "genesisrag17.v1" + }, + "scope": { + "type": "object", + "required": [ + "portfolioId", + "tenantId", + "businessId", + "workspaceId", + "agentId", + "visibility" + ] + }, + "relayCredential": { + "type": "string", + "minLength": 1 + }, + "authenticatedPrincipal": { + "type": "object", + "required": [ + "principalId", + "role", + "scope" + ] + }, + "receipt": { + "type": "object" + } + }, + "required": [ + "schemaVersion", + "scope", + "relayCredential", + "authenticatedPrincipal", + "receipt" + ], + "additionalProperties": true + } + }, + { + "name": "gks_pipeline_gate", + "description": "Evaluates the five GenesisRAG17 quality dimensions against immutable evidence and a physical receipt.", + "inputSchema": { + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "const": "genesisrag17.v1" + }, + "scope": { + "type": "object", + "required": [ + "portfolioId", + "tenantId", + "businessId", + "workspaceId", + "agentId", + "visibility" + ] + }, + "relayCredential": { + "type": "string", + "minLength": 1 + }, + "authenticatedPrincipal": { + "type": "object", + "required": [ + "principalId", + "role", + "scope" + ] + } + }, + "required": [ + "schemaVersion", + "scope", + "relayCredential", + "authenticatedPrincipal", + "decisionId", + "decisionHash" + ], + "additionalProperties": true + } + }, + { + "name": "gks_pipeline_publication_receipt", + "description": "Records the Tier4 publication receipt and closes Stage 17 evidence after a passing gate.", + "inputSchema": { + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "const": "genesisrag17.v1" + }, + "scope": { + "type": "object", + "required": [ + "portfolioId", + "tenantId", + "businessId", + "workspaceId", + "agentId", + "visibility" + ] + }, + "relayCredential": { + "type": "string", + "minLength": 1 + }, + "authenticatedPrincipal": { + "type": "object", + "required": [ + "principalId", + "role", + "scope" + ] + }, + "receipt": { + "type": "object" + } + }, + "required": [ + "schemaVersion", + "scope", + "relayCredential", + "authenticatedPrincipal", + "receipt" + ], + "additionalProperties": true + } + }, + { + "name": "gks_pipeline_evidence", + "description": "Pulls immutable GenesisRAG17 stage terminal evidence by scoped cursor.", + "inputSchema": { + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "const": "genesisrag17.v1" + }, + "scope": { + "type": "object", + "required": [ + "portfolioId", + "tenantId", + "businessId", + "workspaceId", + "agentId", + "visibility" + ] + }, + "relayCredential": { + "type": "string", + "minLength": 1 + }, + "authenticatedPrincipal": { + "type": "object", + "required": [ + "principalId", + "role", + "scope" + ] + }, + "runId": { + "type": "string", + "minLength": 1 + }, + "afterCursor": { + "type": "integer", + "minimum": 0 + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 500 + } + }, + "required": [ + "schemaVersion", + "scope", + "relayCredential", + "authenticatedPrincipal", + "runId" + ], + "additionalProperties": true + } + } + ] + } + } + }, + { + "step": 3, + "kind": "call", + "name": "health", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "service": "gks", + "state": "ready", + "graphVersion": "gks:graph/0" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-002.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-002.json new file mode 100644 index 0000000..82932de --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-002.json @@ -0,0 +1,92 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_6085e62a01695dde117c6af7e427e491", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "replay", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_6085e62a01695dde117c6af7e427e491", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": true, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-003.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-003.json new file mode 100644 index 0000000..3539a77 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-003.json @@ -0,0 +1,92 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_c630ff1052d36234b438c22a63bd5967", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "search", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [ + { + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity.", + "sourceRef": null, + "confidence": null, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "metadata": {}, + "aliases": [], + "externalRefs": [], + "normKey": "feat line linking", + "normVersion": "norm_v1", + "supersededBy": null, + "createdAt": "", + "updatedAt": "", + "graphVersion": "gks:graph/1" + } + ] + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-004.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-004.json new file mode 100644 index 0000000..03ec235 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-004.json @@ -0,0 +1,90 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_bf1f1f92baea2a2fe873a84564112d92", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "entity", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "candidateRef": "FEAT-LINE-LINKING", + "type": "FEAT", + "title": "LINE account linking", + "summary": "Links LINE accounts to customer identity.", + "sourceRef": null, + "confidence": null, + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "metadata": {}, + "aliases": [], + "externalRefs": [], + "normKey": "feat line linking", + "normVersion": "norm_v1", + "supersededBy": null, + "createdAt": "", + "updatedAt": "", + "graphVersion": "gks:graph/1" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-005.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-005.json new file mode 100644 index 0000000..791ddc7 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-005.json @@ -0,0 +1,85 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_dbc3c74737df88c6e32d1eee02212b05", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "relations", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [ + { + "canonicalRef": "gks:relation/da9b3ff19275c533ffa5f1b3c692e140", + "fromRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "relationType": "DEPENDS_ON", + "toRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "confidence": null, + "evidenceRef": "msp:proof/c0-tool-relations", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "metadata": {}, + "createdAt": "", + "graphVersion": "gks:graph/1" + } + ] + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-006.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-006.json new file mode 100644 index 0000000..fef1c5f --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-006.json @@ -0,0 +1,72 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_29baf5c9e5611f8920d12b3e1c916340", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "link", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "canonicalRef": "gks:artifact-link/78375856f3d103ae76b9ecae714f81e5", + "knowledgeRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "artifactRef": "artifact:c0/spec-line-linking", + "relationType": "DESCRIBED_BY", + "evidenceRef": "msp:proof/c0-tool-artifact-link", + "graphVersion": "gks:graph/2" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-007.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-007.json new file mode 100644 index 0000000..64c3b52 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-007.json @@ -0,0 +1,122 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_d7ac715f9fdf706491b29562edf78262", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "conflict", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_8d3c00697e4aef07a8fd088dd8bf97af", + "source_hash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "idempotent": false, + "graph_version": "gks:graph/2", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": null, + "canonicalType": "ENTITY", + "resolution": { + "outcome": "REVIEW_REQUIRED", + "strategy": "EXACT", + "confidence": 0.6 + } + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "list", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [ + { + "mentionId": "gks:mention/7ecd8583e22afd24b9e184bcce9fb86b", + "candidateRef": "FEAT-LINE-LINKING", + "normKey": "feat line linking", + "outcome": "REVIEW_REQUIRED", + "strategy": "EXACT", + "confidence": 0.6, + "canonicalRef": null, + "provenanceRef": "msp:proof/c0-tool-review-list-2", + "promotionIdempotencyKey": "c0-tool-review-list-2", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "fieldDiffs": [], + "decidedAt": "" + } + ] + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-008.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-008.json new file mode 100644 index 0000000..4ea1a34 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-008.json @@ -0,0 +1,166 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_214953086358964b0eb350092c0d3df3", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "conflict", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_5ed11acea1064e3f446bc498b3841269", + "source_hash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "idempotent": false, + "graph_version": "gks:graph/2", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": null, + "canonicalType": "ENTITY", + "resolution": { + "outcome": "REVIEW_REQUIRED", + "strategy": "EXACT", + "confidence": 0.6 + } + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "list", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [ + { + "mentionId": "gks:mention/c5a7ca2d043aba20e3297fe00ea5002d", + "candidateRef": "FEAT-LINE-LINKING", + "normKey": "feat line linking", + "outcome": "REVIEW_REQUIRED", + "strategy": "EXACT", + "confidence": 0.6, + "canonicalRef": null, + "provenanceRef": "msp:proof/c0-tool-review-apply-2", + "promotionIdempotencyKey": "c0-tool-review-apply-2", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "fieldDiffs": [], + "decidedAt": "" + } + ] + } + } + }, + { + "step": 4, + "kind": "call", + "name": "apply", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "action": "BIND", + "mentionId": "gks:mention/c5a7ca2d043aba20e3297fe00ea5002d", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "outcome": "MATCHED", + "strategy": "HUMAN", + "graphVersion": "gks:graph/3", + "materializedRelations": [] + } + } + } + }, + { + "step": 5, + "kind": "call", + "name": "after", + "response": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": [] + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-009.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-009.json new file mode 100644 index 0000000..273bd8a --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-009.json @@ -0,0 +1,238 @@ +[ + { + "step": 1, + "kind": "call", + "name": "promote", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_4724c781ad62b49a1016503ea2887858", + "source_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "idempotent": false, + "graph_version": "gks:graph/1", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "CREATED", + "strategy": "CREATED", + "confidence": 1 + } + } + ] + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "promote2", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "knowledge_ref": "gks:knowledge/gks_knowledge_cd6646718f88edd87657e08865363b77", + "source_hash": "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd", + "idempotent": false, + "graph_version": "gks:graph/2", + "canonical_mappings": [ + { + "candidateRef": "FEAT-LINE-LINKING", + "canonicalRef": "gks:entity/feat-line-linking-26c4011eb56133c475887684445b6c40", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "MATCHED", + "strategy": "EXACT", + "confidence": 0.95 + } + }, + { + "candidateRef": "ENTITY-CUSTOMER-IDENTITY", + "canonicalRef": "gks:entity/entity-customer-identity-e8e594746dbeacc200e18c868c029437", + "canonicalType": "ENTITY", + "resolution": { + "outcome": "MATCHED", + "strategy": "EXACT", + "confidence": 0.95 + } + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "page1", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "rows": [ + { + "cursor": 1, + "evidence_id": "gks:evidence/f058448caae63566744143c68133fc6a", + "pipeline_stage_id": "DPS-KI-ENTITY-RESOLVE", + "pipeline_definition_id": "DPL-KNOWLEDGE-INGEST-V1", + "execution_contract_id": "EXC-KNOWLEDGE-INGEST-V1", + "run_id": "c0-tool-export-run", + "provenance_ref": "msp:proof/c0-tool-export", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "evidence": { + "outcomes": { + "MATCHED": 0, + "CREATED": 2, + "AMBIGUOUS": 0, + "REVIEW_REQUIRED": 0, + "REJECTED": 0 + }, + "strategies": { + "CANONICAL_REF": 0, + "EXTERNAL_REF": 0, + "EXACT": 0, + "ALIAS": 0, + "DETERMINISTIC": 0, + "FUZZY": 0, + "CREATED": 2, + "HUMAN": 0, + "BACKFILL": 0 + }, + "knowledge_ref": "gks:knowledge/gks_knowledge_4724c781ad62b49a1016503ea2887858", + "graph_version": "gks:graph/1", + "automerge_floor": 0.85, + "requested_pipeline_stage_id": null + }, + "metrics": { + "records_in": 2, + "records_out": 2, + "records_failed": 0, + "records_quarantined": 0, + "processing_time_ms": "", + "retry_count": 0 + }, + "records": [], + "produced_at": "" + } + ], + "next_cursor": 1 + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "page2", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "rows": [ + { + "cursor": 2, + "evidence_id": "gks:evidence/4dfeff49e064d93dbeca88309527609d", + "pipeline_stage_id": "DPS-KI-ENTITY-RESOLVE", + "pipeline_definition_id": "DPL-KNOWLEDGE-INGEST-V1", + "execution_contract_id": "EXC-KNOWLEDGE-INGEST-V1", + "run_id": "c0-tool-export-2-run", + "provenance_ref": "msp:proof/c0-tool-export-2", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "evidence": { + "outcomes": { + "MATCHED": 2, + "CREATED": 0, + "AMBIGUOUS": 0, + "REVIEW_REQUIRED": 0, + "REJECTED": 0 + }, + "strategies": { + "CANONICAL_REF": 0, + "EXTERNAL_REF": 0, + "EXACT": 2, + "ALIAS": 0, + "DETERMINISTIC": 0, + "FUZZY": 0, + "CREATED": 0, + "HUMAN": 0, + "BACKFILL": 0 + }, + "knowledge_ref": "gks:knowledge/gks_knowledge_cd6646718f88edd87657e08865363b77", + "graph_version": "gks:graph/2", + "automerge_floor": 0.85, + "requested_pipeline_stage_id": null + }, + "metrics": { + "records_in": 2, + "records_out": 2, + "records_failed": 0, + "records_quarantined": 0, + "processing_time_ms": "", + "retry_count": 0 + }, + "records": [], + "produced_at": "" + } + ], + "next_cursor": 2 + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-010.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-010.json new file mode 100644 index 0000000..52456b6 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-010.json @@ -0,0 +1,66 @@ +[ + { + "step": 1, + "kind": "call", + "name": "submit", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-submit", + "decisionId": "gks:decision/e1e0dd2e1aa35b0a00af6ebc138c1594", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "replay", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-submit", + "decisionId": "gks:decision/e1e0dd2e1aa35b0a00af6ebc138c1594", + "status": "PENDING", + "idempotent": true + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-011.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-011.json new file mode 100644 index 0000000..5a17a77 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-011.json @@ -0,0 +1,749 @@ +[ + { + "step": 1, + "kind": "call", + "name": "submit", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-claim", + "decisionId": "gks:decision/2f79b27ec6225c2fa15f0ae84134951d", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "claim", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisions": [ + { + "batchId": "c0-claim", + "chunks": [ + { + "chunkId": "c0-claim-chunk-1", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "endOffset": 25, + "ordinal": 0, + "parsedArtifactId": "c0-claim-parsed", + "startOffset": 0, + "text": "Alice works for Acme Ltd." + }, + { + "chunkId": "c0-claim-chunk-2", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "endOffset": 48, + "ordinal": 1, + "parsedArtifactId": "c0-claim-parsed", + "startOffset": 26, + "text": "Alice purchased Atlas." + }, + { + "chunkId": "c0-claim-chunk-3", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "endOffset": 74, + "ordinal": 2, + "parsedArtifactId": "c0-claim-parsed", + "startOffset": 49, + "text": "Bob works for Beacon Ltd." + }, + { + "chunkId": "c0-claim-chunk-4", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "endOffset": 96, + "ordinal": 3, + "parsedArtifactId": "c0-claim-parsed", + "startOffset": 75, + "text": "Bob purchased Nimbus." + }, + { + "chunkId": "c0-claim-chunk-5", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "endOffset": 123, + "ordinal": 4, + "parsedArtifactId": "c0-claim-parsed", + "startOffset": 97, + "text": "Carol works for Cedar Ltd." + } + ], + "decisionHash": "", + "decisionId": "gks:decision/2f79b27ec6225c2fa15f0ae84134951d", + "derived": [], + "entities": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "mentions": [ + "c0-claim-mention-1-1", + "c0-claim-mention-2-1" + ], + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "name": "Alice", + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "mentions": [ + "c0-claim-mention-1-2" + ], + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "name": "Acme Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "mentions": [ + "c0-claim-mention-2-2" + ], + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "name": "Atlas", + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "mentions": [ + "c0-claim-mention-3-1", + "c0-claim-mention-4-1" + ], + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "name": "Bob", + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "mentions": [ + "c0-claim-mention-3-2" + ], + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "name": "Beacon Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "mentions": [ + "c0-claim-mention-4-2" + ], + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "name": "Nimbus", + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "mentions": [ + "c0-claim-mention-5-1" + ], + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "name": "Carol", + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "mentions": [ + "c0-claim-mention-5-2" + ], + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "name": "Cedar Ltd.", + "semanticType": "Organization" + } + ], + "expectedGraphReadback": { + "edgeCount": 26, + "nodeCount": 20 + }, + "facts": [ + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/50c927546732471d1fc8c5e68952cfc2", + "objectId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-claim-chunk-1", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-1-1", + "c0-claim-mention-1-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/298a79e92b6a6c536073558628bc00dd", + "objectId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-claim-chunk-2", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-2-1", + "c0-claim-mention-2-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/216141dc864ddd25d76ebbda35ac8a90", + "objectId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-claim-chunk-3", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-3-1", + "c0-claim-mention-3-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/43490664aa5f6b8b7487c3facddd9015", + "objectId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-claim-chunk-4", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-4-1", + "c0-claim-mention-4-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/5245e37322275981949671e41ecbc326", + "objectId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-claim-chunk-5", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-5-1", + "c0-claim-mention-5-2" + ] + }, + "subjectId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + } + ], + "graph": { + "edges": [ + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/50c927546732471d1fc8c5e68952cfc2", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-claim-chunk-1", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-1-1", + "c0-claim-mention-1-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef" + }, + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/298a79e92b6a6c536073558628bc00dd", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-claim-chunk-2", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-2-1", + "c0-claim-mention-2-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/216141dc864ddd25d76ebbda35ac8a90", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-claim-chunk-3", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-3-1", + "c0-claim-mention-3-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/43490664aa5f6b8b7487c3facddd9015", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-claim-chunk-4", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-4-1", + "c0-claim-mention-4-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637" + }, + { + "confidence": 0.9, + "from": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "id": "gks:fact/5245e37322275981949671e41ecbc326", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-claim-chunk-5", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "sourceMentionIds": [ + "c0-claim-mention-5-1", + "c0-claim-mention-5-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/cedar-1580060aacced42afb786146c028fed1" + } + ], + "nodes": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "semanticType": "Organization" + } + ] + }, + "held": [], + "mentions": [ + { + "chunkId": "c0-claim-chunk-1", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-claim-mention-1-1", + "startOffset": 0 + }, + { + "chunkId": "c0-claim-chunk-1", + "endOffset": 25, + "name": "Acme Ltd.", + "resolutionKey": "acme", + "semanticType": "Organization", + "sourceMentionId": "c0-claim-mention-1-2", + "startOffset": 16 + }, + { + "chunkId": "c0-claim-chunk-2", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-claim-mention-2-1", + "startOffset": 0 + }, + { + "chunkId": "c0-claim-chunk-2", + "endOffset": 21, + "name": "Atlas", + "resolutionKey": "atlas", + "semanticType": "Product", + "sourceMentionId": "c0-claim-mention-2-2", + "startOffset": 16 + }, + { + "chunkId": "c0-claim-chunk-3", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-claim-mention-3-1", + "startOffset": 0 + }, + { + "chunkId": "c0-claim-chunk-3", + "endOffset": 25, + "name": "Beacon Ltd.", + "resolutionKey": "beacon", + "semanticType": "Organization", + "sourceMentionId": "c0-claim-mention-3-2", + "startOffset": 14 + }, + { + "chunkId": "c0-claim-chunk-4", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-claim-mention-4-1", + "startOffset": 0 + }, + { + "chunkId": "c0-claim-chunk-4", + "endOffset": 20, + "name": "Nimbus", + "resolutionKey": "nimbus", + "semanticType": "Product", + "sourceMentionId": "c0-claim-mention-4-2", + "startOffset": 14 + }, + { + "chunkId": "c0-claim-chunk-5", + "endOffset": 5, + "name": "Carol", + "resolutionKey": "carol", + "semanticType": "Person", + "sourceMentionId": "c0-claim-mention-5-1", + "startOffset": 0 + }, + { + "chunkId": "c0-claim-chunk-5", + "endOffset": 26, + "name": "Cedar Ltd.", + "resolutionKey": "cedar", + "semanticType": "Organization", + "sourceMentionId": "c0-claim-mention-5-2", + "startOffset": 16 + } + ], + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "runId": "c0-claim-run", + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "source": { + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd.", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "documentId": "c0-claim-document", + "parsedArtifactId": "c0-claim-parsed", + "rawArtifactId": "c0-claim-raw", + "sourceId": "c0-claim-source", + "version": "1" + }, + "stageMetrics": { + "9": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0 + }, + "10": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "11": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "12": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "unmapped": 0 + }, + "13": { + "records_in": 13, + "records_out": 5, + "records_quarantined": 0 + }, + "14": { + "records_in": 8, + "records_out": 0, + "records_quarantined": 0 + } + }, + "stages": [ + { + "attemptId": "c0-claim-attempt-9", + "executionStepId": "c0-claim-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-claim-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-claim-attempt-10", + "executionStepId": "c0-claim-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-claim-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-claim-attempt-11", + "executionStepId": "c0-claim-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-claim-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-claim-attempt-12", + "executionStepId": "c0-claim-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-claim-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-claim-attempt-13", + "executionStepId": "c0-claim-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-claim-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-claim-attempt-14", + "executionStepId": "c0-claim-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-claim-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-claim-attempt-15", + "executionStepId": "c0-claim-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-claim-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-claim-attempt-16", + "executionStepId": "c0-claim-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-claim-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-claim-attempt-17", + "executionStepId": "c0-claim-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-claim-run", + "stageNumber": 17 + } + ] + } + ] + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-012.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-012.json new file mode 100644 index 0000000..0fdf352 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-012.json @@ -0,0 +1,1209 @@ +[ + { + "step": 1, + "kind": "call", + "name": "submit", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-graph", + "decisionId": "gks:decision/1e310d8ecb8d8d01e75ff8bd1c6adf4e", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "claim", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisions": [ + { + "batchId": "c0-graph", + "chunks": [ + { + "chunkId": "c0-graph-chunk-1", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "endOffset": 25, + "ordinal": 0, + "parsedArtifactId": "c0-graph-parsed", + "startOffset": 0, + "text": "Alice works for Acme Ltd." + }, + { + "chunkId": "c0-graph-chunk-2", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "endOffset": 48, + "ordinal": 1, + "parsedArtifactId": "c0-graph-parsed", + "startOffset": 26, + "text": "Alice purchased Atlas." + }, + { + "chunkId": "c0-graph-chunk-3", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "endOffset": 74, + "ordinal": 2, + "parsedArtifactId": "c0-graph-parsed", + "startOffset": 49, + "text": "Bob works for Beacon Ltd." + }, + { + "chunkId": "c0-graph-chunk-4", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "endOffset": 96, + "ordinal": 3, + "parsedArtifactId": "c0-graph-parsed", + "startOffset": 75, + "text": "Bob purchased Nimbus." + }, + { + "chunkId": "c0-graph-chunk-5", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "endOffset": 123, + "ordinal": 4, + "parsedArtifactId": "c0-graph-parsed", + "startOffset": 97, + "text": "Carol works for Cedar Ltd." + } + ], + "decisionHash": "", + "decisionId": "gks:decision/1e310d8ecb8d8d01e75ff8bd1c6adf4e", + "derived": [], + "entities": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "mentions": [ + "c0-graph-mention-1-1", + "c0-graph-mention-2-1" + ], + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "name": "Alice", + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "mentions": [ + "c0-graph-mention-1-2" + ], + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "name": "Acme Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "mentions": [ + "c0-graph-mention-2-2" + ], + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "name": "Atlas", + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "mentions": [ + "c0-graph-mention-3-1", + "c0-graph-mention-4-1" + ], + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "name": "Bob", + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "mentions": [ + "c0-graph-mention-3-2" + ], + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "name": "Beacon Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "mentions": [ + "c0-graph-mention-4-2" + ], + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "name": "Nimbus", + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "mentions": [ + "c0-graph-mention-5-1" + ], + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "name": "Carol", + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "mentions": [ + "c0-graph-mention-5-2" + ], + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "name": "Cedar Ltd.", + "semanticType": "Organization" + } + ], + "expectedGraphReadback": { + "edgeCount": 26, + "nodeCount": 20 + }, + "facts": [ + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/7cc6d2194902a9c331afd392383808ba", + "objectId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-graph-chunk-1", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-1-1", + "c0-graph-mention-1-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/533b495d2f089cd294972766dae9fbd6", + "objectId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-graph-chunk-2", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-2-1", + "c0-graph-mention-2-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/52b1d7a187d37987eac041054e870fc5", + "objectId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-graph-chunk-3", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-3-1", + "c0-graph-mention-3-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/64e06121eaedf1f1c882731a102a902a", + "objectId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-graph-chunk-4", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-4-1", + "c0-graph-mention-4-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/ee3db31650f6530193769de9fda6f5a0", + "objectId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-graph-chunk-5", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-5-1", + "c0-graph-mention-5-2" + ] + }, + "subjectId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + } + ], + "graph": { + "edges": [ + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/7cc6d2194902a9c331afd392383808ba", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-graph-chunk-1", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-1-1", + "c0-graph-mention-1-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef" + }, + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/533b495d2f089cd294972766dae9fbd6", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-graph-chunk-2", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-2-1", + "c0-graph-mention-2-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/52b1d7a187d37987eac041054e870fc5", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-graph-chunk-3", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-3-1", + "c0-graph-mention-3-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/64e06121eaedf1f1c882731a102a902a", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-graph-chunk-4", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-4-1", + "c0-graph-mention-4-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637" + }, + { + "confidence": 0.9, + "from": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "id": "gks:fact/ee3db31650f6530193769de9fda6f5a0", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-graph-chunk-5", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-5-1", + "c0-graph-mention-5-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/cedar-1580060aacced42afb786146c028fed1" + } + ], + "nodes": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "semanticType": "Organization" + } + ] + }, + "held": [], + "mentions": [ + { + "chunkId": "c0-graph-chunk-1", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-graph-mention-1-1", + "startOffset": 0 + }, + { + "chunkId": "c0-graph-chunk-1", + "endOffset": 25, + "name": "Acme Ltd.", + "resolutionKey": "acme", + "semanticType": "Organization", + "sourceMentionId": "c0-graph-mention-1-2", + "startOffset": 16 + }, + { + "chunkId": "c0-graph-chunk-2", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-graph-mention-2-1", + "startOffset": 0 + }, + { + "chunkId": "c0-graph-chunk-2", + "endOffset": 21, + "name": "Atlas", + "resolutionKey": "atlas", + "semanticType": "Product", + "sourceMentionId": "c0-graph-mention-2-2", + "startOffset": 16 + }, + { + "chunkId": "c0-graph-chunk-3", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-graph-mention-3-1", + "startOffset": 0 + }, + { + "chunkId": "c0-graph-chunk-3", + "endOffset": 25, + "name": "Beacon Ltd.", + "resolutionKey": "beacon", + "semanticType": "Organization", + "sourceMentionId": "c0-graph-mention-3-2", + "startOffset": 14 + }, + { + "chunkId": "c0-graph-chunk-4", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-graph-mention-4-1", + "startOffset": 0 + }, + { + "chunkId": "c0-graph-chunk-4", + "endOffset": 20, + "name": "Nimbus", + "resolutionKey": "nimbus", + "semanticType": "Product", + "sourceMentionId": "c0-graph-mention-4-2", + "startOffset": 14 + }, + { + "chunkId": "c0-graph-chunk-5", + "endOffset": 5, + "name": "Carol", + "resolutionKey": "carol", + "semanticType": "Person", + "sourceMentionId": "c0-graph-mention-5-1", + "startOffset": 0 + }, + { + "chunkId": "c0-graph-chunk-5", + "endOffset": 26, + "name": "Cedar Ltd.", + "resolutionKey": "cedar", + "semanticType": "Organization", + "sourceMentionId": "c0-graph-mention-5-2", + "startOffset": 16 + } + ], + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "runId": "c0-graph-run", + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "source": { + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd.", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "documentId": "c0-graph-document", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "version": "1" + }, + "stageMetrics": { + "9": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0 + }, + "10": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "11": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "12": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "unmapped": 0 + }, + "13": { + "records_in": 13, + "records_out": 5, + "records_quarantined": 0 + }, + "14": { + "records_in": 8, + "records_out": 0, + "records_quarantined": 0 + } + }, + "stages": [ + { + "attemptId": "c0-graph-attempt-9", + "executionStepId": "c0-graph-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-graph-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-graph-attempt-10", + "executionStepId": "c0-graph-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-graph-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-graph-attempt-11", + "executionStepId": "c0-graph-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-graph-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-graph-attempt-12", + "executionStepId": "c0-graph-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-graph-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-graph-attempt-13", + "executionStepId": "c0-graph-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-graph-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-graph-attempt-14", + "executionStepId": "c0-graph-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-graph-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-graph-attempt-15", + "executionStepId": "c0-graph-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-graph-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-graph-attempt-16", + "executionStepId": "c0-graph-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-graph-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-graph-attempt-17", + "executionStepId": "c0-graph-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-graph-run", + "stageNumber": 17 + } + ] + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "graph", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/074955519c665816bf78e7369af3c90b", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-1", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-1-1", + "c0-graph-mention-1-2" + ] + }, + { + "chunkId": "c0-graph-chunk-2", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-2-1", + "c0-graph-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/1b1a322efe1c116afc0339db786479ea", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-1", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-1-1", + "c0-graph-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/4cde46c3fd32a2af24c3aa0c9ef260ed", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-2", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-2-1", + "c0-graph-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/5567609258140adbe58fa18c4701838b", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-3", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-3-1", + "c0-graph-mention-3-2" + ] + }, + { + "chunkId": "c0-graph-chunk-4", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-4-1", + "c0-graph-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/a09bc8f4d07aac4ed41d0af64a78e04f", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-3", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-3-1", + "c0-graph-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/4fb0829a40f01e8f784144745bd76b88", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-4", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-4-1", + "c0-graph-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/fed7d7a6b9ccc4ebb748fe09de2f927d", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-5", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-5-1", + "c0-graph-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/842bca2c2a2432a3517b0f27f4ceff5b", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-5", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-5-1", + "c0-graph-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "replay", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": true, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/074955519c665816bf78e7369af3c90b", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-1", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-1-1", + "c0-graph-mention-1-2" + ] + }, + { + "chunkId": "c0-graph-chunk-2", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-2-1", + "c0-graph-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/1b1a322efe1c116afc0339db786479ea", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-1", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-1-1", + "c0-graph-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/4cde46c3fd32a2af24c3aa0c9ef260ed", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-2", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-2-1", + "c0-graph-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/5567609258140adbe58fa18c4701838b", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-3", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-3-1", + "c0-graph-mention-3-2" + ] + }, + { + "chunkId": "c0-graph-chunk-4", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-4-1", + "c0-graph-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/a09bc8f4d07aac4ed41d0af64a78e04f", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-3", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-3-1", + "c0-graph-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/4fb0829a40f01e8f784144745bd76b88", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-4", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-4-1", + "c0-graph-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/fed7d7a6b9ccc4ebb748fe09de2f927d", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-5", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-5-1", + "c0-graph-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/842bca2c2a2432a3517b0f27f4ceff5b", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-graph-chunk-5", + "parsedArtifactId": "c0-graph-parsed", + "rawArtifactId": "c0-graph-raw", + "sourceId": "c0-graph-source", + "sourceMentionIds": [ + "c0-graph-mention-5-1", + "c0-graph-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-013.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-013.json new file mode 100644 index 0000000..32c30f1 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-013.json @@ -0,0 +1,1017 @@ +[ + { + "step": 1, + "kind": "call", + "name": "submit", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-failure", + "decisionId": "gks:decision/8225cee9db4349766f70351d26aa3c65", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "claim", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisions": [ + { + "batchId": "c0-failure", + "chunks": [ + { + "chunkId": "c0-failure-chunk-1", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "endOffset": 25, + "ordinal": 0, + "parsedArtifactId": "c0-failure-parsed", + "startOffset": 0, + "text": "Alice works for Acme Ltd." + }, + { + "chunkId": "c0-failure-chunk-2", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "endOffset": 48, + "ordinal": 1, + "parsedArtifactId": "c0-failure-parsed", + "startOffset": 26, + "text": "Alice purchased Atlas." + }, + { + "chunkId": "c0-failure-chunk-3", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "endOffset": 74, + "ordinal": 2, + "parsedArtifactId": "c0-failure-parsed", + "startOffset": 49, + "text": "Bob works for Beacon Ltd." + }, + { + "chunkId": "c0-failure-chunk-4", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "endOffset": 96, + "ordinal": 3, + "parsedArtifactId": "c0-failure-parsed", + "startOffset": 75, + "text": "Bob purchased Nimbus." + }, + { + "chunkId": "c0-failure-chunk-5", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "endOffset": 123, + "ordinal": 4, + "parsedArtifactId": "c0-failure-parsed", + "startOffset": 97, + "text": "Carol works for Cedar Ltd." + } + ], + "decisionHash": "", + "decisionId": "gks:decision/8225cee9db4349766f70351d26aa3c65", + "derived": [], + "entities": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "mentions": [ + "c0-failure-mention-1-1", + "c0-failure-mention-2-1" + ], + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "name": "Alice", + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "mentions": [ + "c0-failure-mention-1-2" + ], + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "name": "Acme Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "mentions": [ + "c0-failure-mention-2-2" + ], + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "name": "Atlas", + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "mentions": [ + "c0-failure-mention-3-1", + "c0-failure-mention-4-1" + ], + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "name": "Bob", + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "mentions": [ + "c0-failure-mention-3-2" + ], + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "name": "Beacon Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "mentions": [ + "c0-failure-mention-4-2" + ], + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "name": "Nimbus", + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "mentions": [ + "c0-failure-mention-5-1" + ], + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "name": "Carol", + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "mentions": [ + "c0-failure-mention-5-2" + ], + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "name": "Cedar Ltd.", + "semanticType": "Organization" + } + ], + "expectedGraphReadback": { + "edgeCount": 26, + "nodeCount": 20 + }, + "facts": [ + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/3dc4e5f5d810983af9387b7993e16675", + "objectId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-failure-chunk-1", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-1-1", + "c0-failure-mention-1-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/137a99ec11119355585d9621e7ad597d", + "objectId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-failure-chunk-2", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-2-1", + "c0-failure-mention-2-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/325c3c6f181f645d0479608aa3f0c8ff", + "objectId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-failure-chunk-3", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-3-1", + "c0-failure-mention-3-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/0abe760891bea8c9f267d7a44b06228c", + "objectId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-failure-chunk-4", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-4-1", + "c0-failure-mention-4-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/1139d09a096050d97548d9e9cd4e66b2", + "objectId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-failure-chunk-5", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-5-1", + "c0-failure-mention-5-2" + ] + }, + "subjectId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + } + ], + "graph": { + "edges": [ + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/3dc4e5f5d810983af9387b7993e16675", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-failure-chunk-1", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-1-1", + "c0-failure-mention-1-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef" + }, + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/137a99ec11119355585d9621e7ad597d", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-failure-chunk-2", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-2-1", + "c0-failure-mention-2-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/325c3c6f181f645d0479608aa3f0c8ff", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-failure-chunk-3", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-3-1", + "c0-failure-mention-3-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/0abe760891bea8c9f267d7a44b06228c", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-failure-chunk-4", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-4-1", + "c0-failure-mention-4-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637" + }, + { + "confidence": 0.9, + "from": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "id": "gks:fact/1139d09a096050d97548d9e9cd4e66b2", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-failure-chunk-5", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-5-1", + "c0-failure-mention-5-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/cedar-1580060aacced42afb786146c028fed1" + } + ], + "nodes": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "semanticType": "Organization" + } + ] + }, + "held": [], + "mentions": [ + { + "chunkId": "c0-failure-chunk-1", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-failure-mention-1-1", + "startOffset": 0 + }, + { + "chunkId": "c0-failure-chunk-1", + "endOffset": 25, + "name": "Acme Ltd.", + "resolutionKey": "acme", + "semanticType": "Organization", + "sourceMentionId": "c0-failure-mention-1-2", + "startOffset": 16 + }, + { + "chunkId": "c0-failure-chunk-2", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-failure-mention-2-1", + "startOffset": 0 + }, + { + "chunkId": "c0-failure-chunk-2", + "endOffset": 21, + "name": "Atlas", + "resolutionKey": "atlas", + "semanticType": "Product", + "sourceMentionId": "c0-failure-mention-2-2", + "startOffset": 16 + }, + { + "chunkId": "c0-failure-chunk-3", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-failure-mention-3-1", + "startOffset": 0 + }, + { + "chunkId": "c0-failure-chunk-3", + "endOffset": 25, + "name": "Beacon Ltd.", + "resolutionKey": "beacon", + "semanticType": "Organization", + "sourceMentionId": "c0-failure-mention-3-2", + "startOffset": 14 + }, + { + "chunkId": "c0-failure-chunk-4", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-failure-mention-4-1", + "startOffset": 0 + }, + { + "chunkId": "c0-failure-chunk-4", + "endOffset": 20, + "name": "Nimbus", + "resolutionKey": "nimbus", + "semanticType": "Product", + "sourceMentionId": "c0-failure-mention-4-2", + "startOffset": 14 + }, + { + "chunkId": "c0-failure-chunk-5", + "endOffset": 5, + "name": "Carol", + "resolutionKey": "carol", + "semanticType": "Person", + "sourceMentionId": "c0-failure-mention-5-1", + "startOffset": 0 + }, + { + "chunkId": "c0-failure-chunk-5", + "endOffset": 26, + "name": "Cedar Ltd.", + "resolutionKey": "cedar", + "semanticType": "Organization", + "sourceMentionId": "c0-failure-mention-5-2", + "startOffset": 16 + } + ], + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "runId": "c0-failure-run", + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "source": { + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd.", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "documentId": "c0-failure-document", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "version": "1" + }, + "stageMetrics": { + "9": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0 + }, + "10": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "11": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "12": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "unmapped": 0 + }, + "13": { + "records_in": 13, + "records_out": 5, + "records_quarantined": 0 + }, + "14": { + "records_in": 8, + "records_out": 0, + "records_quarantined": 0 + } + }, + "stages": [ + { + "attemptId": "c0-failure-attempt-9", + "executionStepId": "c0-failure-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-failure-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-failure-attempt-10", + "executionStepId": "c0-failure-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-failure-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-failure-attempt-11", + "executionStepId": "c0-failure-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-failure-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-failure-attempt-12", + "executionStepId": "c0-failure-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-failure-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-failure-attempt-13", + "executionStepId": "c0-failure-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-failure-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-failure-attempt-14", + "executionStepId": "c0-failure-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-failure-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-failure-attempt-15", + "executionStepId": "c0-failure-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-failure-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-failure-attempt-16", + "executionStepId": "c0-failure-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-failure-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-failure-attempt-17", + "executionStepId": "c0-failure-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-failure-run", + "stageNumber": 17 + } + ] + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "graph", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/0d92c3e44b46cafcbe0f5465448a6497", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-failure-chunk-1", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-1-1", + "c0-failure-mention-1-2" + ] + }, + { + "chunkId": "c0-failure-chunk-2", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-2-1", + "c0-failure-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/da751022664d73147bb26f4639f17b5b", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-failure-chunk-1", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-1-1", + "c0-failure-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/156254263402f15618bf444c0a5cdb1e", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-failure-chunk-2", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-2-1", + "c0-failure-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/02debaea95e93c7134ba8982d9c08e3e", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-failure-chunk-3", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-3-1", + "c0-failure-mention-3-2" + ] + }, + { + "chunkId": "c0-failure-chunk-4", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-4-1", + "c0-failure-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/b71a65a682f6f34fdaf94ab919f795f8", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-failure-chunk-3", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-3-1", + "c0-failure-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/2020803ae22498bb1a8de21b6695c73c", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-failure-chunk-4", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-4-1", + "c0-failure-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/825ce5e2333d40a5d7050b0849c3efd6", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-failure-chunk-5", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-5-1", + "c0-failure-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/8335ebbf42aeddfa69d0caf8d66183e8", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-failure-chunk-5", + "parsedArtifactId": "c0-failure-parsed", + "rawArtifactId": "c0-failure-raw", + "sourceId": "c0-failure-source", + "sourceMentionIds": [ + "c0-failure-mention-5-1", + "c0-failure-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "failure", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "stage": { + "stageNumber": 15, + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-failure-run", + "executionStepId": "c0-failure-step-15", + "attemptId": "c0-failure-attempt-15" + }, + "failureHash": "" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-014.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-014.json new file mode 100644 index 0000000..4c9c627 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-014.json @@ -0,0 +1,1010 @@ +[ + { + "step": 1, + "kind": "call", + "name": "submit", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-write", + "decisionId": "gks:decision/fb5b3cb608d43044146667e48f0fa41a", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "claim", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisions": [ + { + "batchId": "c0-write", + "chunks": [ + { + "chunkId": "c0-write-chunk-1", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "endOffset": 25, + "ordinal": 0, + "parsedArtifactId": "c0-write-parsed", + "startOffset": 0, + "text": "Alice works for Acme Ltd." + }, + { + "chunkId": "c0-write-chunk-2", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "endOffset": 48, + "ordinal": 1, + "parsedArtifactId": "c0-write-parsed", + "startOffset": 26, + "text": "Alice purchased Atlas." + }, + { + "chunkId": "c0-write-chunk-3", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "endOffset": 74, + "ordinal": 2, + "parsedArtifactId": "c0-write-parsed", + "startOffset": 49, + "text": "Bob works for Beacon Ltd." + }, + { + "chunkId": "c0-write-chunk-4", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "endOffset": 96, + "ordinal": 3, + "parsedArtifactId": "c0-write-parsed", + "startOffset": 75, + "text": "Bob purchased Nimbus." + }, + { + "chunkId": "c0-write-chunk-5", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "endOffset": 123, + "ordinal": 4, + "parsedArtifactId": "c0-write-parsed", + "startOffset": 97, + "text": "Carol works for Cedar Ltd." + } + ], + "decisionHash": "", + "decisionId": "gks:decision/fb5b3cb608d43044146667e48f0fa41a", + "derived": [], + "entities": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "mentions": [ + "c0-write-mention-1-1", + "c0-write-mention-2-1" + ], + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "name": "Alice", + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "mentions": [ + "c0-write-mention-1-2" + ], + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "name": "Acme Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "mentions": [ + "c0-write-mention-2-2" + ], + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "name": "Atlas", + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "mentions": [ + "c0-write-mention-3-1", + "c0-write-mention-4-1" + ], + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "name": "Bob", + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "mentions": [ + "c0-write-mention-3-2" + ], + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "name": "Beacon Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "mentions": [ + "c0-write-mention-4-2" + ], + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "name": "Nimbus", + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "mentions": [ + "c0-write-mention-5-1" + ], + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "name": "Carol", + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "mentions": [ + "c0-write-mention-5-2" + ], + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "name": "Cedar Ltd.", + "semanticType": "Organization" + } + ], + "expectedGraphReadback": { + "edgeCount": 26, + "nodeCount": 20 + }, + "facts": [ + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/ea2caab82617e1d867a2381cfb28460e", + "objectId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-write-chunk-1", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-1-1", + "c0-write-mention-1-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/fabef79ce8eefff696a991c5cde908d4", + "objectId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-write-chunk-2", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-2-1", + "c0-write-mention-2-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/fc07b5f43de3cc44ce8e8f8aab40228b", + "objectId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-write-chunk-3", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-3-1", + "c0-write-mention-3-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/03ebe6efa4884571954780971ea2b113", + "objectId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-write-chunk-4", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-4-1", + "c0-write-mention-4-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/d58dc9d6006f6dd82f18fc978f28d44b", + "objectId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-write-chunk-5", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-5-1", + "c0-write-mention-5-2" + ] + }, + "subjectId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + } + ], + "graph": { + "edges": [ + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/ea2caab82617e1d867a2381cfb28460e", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-write-chunk-1", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-1-1", + "c0-write-mention-1-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef" + }, + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/fabef79ce8eefff696a991c5cde908d4", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-write-chunk-2", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-2-1", + "c0-write-mention-2-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/fc07b5f43de3cc44ce8e8f8aab40228b", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-write-chunk-3", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-3-1", + "c0-write-mention-3-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/03ebe6efa4884571954780971ea2b113", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-write-chunk-4", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-4-1", + "c0-write-mention-4-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637" + }, + { + "confidence": 0.9, + "from": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "id": "gks:fact/d58dc9d6006f6dd82f18fc978f28d44b", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-write-chunk-5", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-5-1", + "c0-write-mention-5-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/cedar-1580060aacced42afb786146c028fed1" + } + ], + "nodes": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "semanticType": "Organization" + } + ] + }, + "held": [], + "mentions": [ + { + "chunkId": "c0-write-chunk-1", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-write-mention-1-1", + "startOffset": 0 + }, + { + "chunkId": "c0-write-chunk-1", + "endOffset": 25, + "name": "Acme Ltd.", + "resolutionKey": "acme", + "semanticType": "Organization", + "sourceMentionId": "c0-write-mention-1-2", + "startOffset": 16 + }, + { + "chunkId": "c0-write-chunk-2", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-write-mention-2-1", + "startOffset": 0 + }, + { + "chunkId": "c0-write-chunk-2", + "endOffset": 21, + "name": "Atlas", + "resolutionKey": "atlas", + "semanticType": "Product", + "sourceMentionId": "c0-write-mention-2-2", + "startOffset": 16 + }, + { + "chunkId": "c0-write-chunk-3", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-write-mention-3-1", + "startOffset": 0 + }, + { + "chunkId": "c0-write-chunk-3", + "endOffset": 25, + "name": "Beacon Ltd.", + "resolutionKey": "beacon", + "semanticType": "Organization", + "sourceMentionId": "c0-write-mention-3-2", + "startOffset": 14 + }, + { + "chunkId": "c0-write-chunk-4", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-write-mention-4-1", + "startOffset": 0 + }, + { + "chunkId": "c0-write-chunk-4", + "endOffset": 20, + "name": "Nimbus", + "resolutionKey": "nimbus", + "semanticType": "Product", + "sourceMentionId": "c0-write-mention-4-2", + "startOffset": 14 + }, + { + "chunkId": "c0-write-chunk-5", + "endOffset": 5, + "name": "Carol", + "resolutionKey": "carol", + "semanticType": "Person", + "sourceMentionId": "c0-write-mention-5-1", + "startOffset": 0 + }, + { + "chunkId": "c0-write-chunk-5", + "endOffset": 26, + "name": "Cedar Ltd.", + "resolutionKey": "cedar", + "semanticType": "Organization", + "sourceMentionId": "c0-write-mention-5-2", + "startOffset": 16 + } + ], + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "runId": "c0-write-run", + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "source": { + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd.", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "documentId": "c0-write-document", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "version": "1" + }, + "stageMetrics": { + "9": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0 + }, + "10": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "11": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "12": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "unmapped": 0 + }, + "13": { + "records_in": 13, + "records_out": 5, + "records_quarantined": 0 + }, + "14": { + "records_in": 8, + "records_out": 0, + "records_quarantined": 0 + } + }, + "stages": [ + { + "attemptId": "c0-write-attempt-9", + "executionStepId": "c0-write-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-write-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-write-attempt-10", + "executionStepId": "c0-write-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-write-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-write-attempt-11", + "executionStepId": "c0-write-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-write-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-write-attempt-12", + "executionStepId": "c0-write-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-write-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-write-attempt-13", + "executionStepId": "c0-write-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-write-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-write-attempt-14", + "executionStepId": "c0-write-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-write-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-write-attempt-15", + "executionStepId": "c0-write-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-write-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-write-attempt-16", + "executionStepId": "c0-write-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-write-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-write-attempt-17", + "executionStepId": "c0-write-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-write-run", + "stageNumber": 17 + } + ] + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "graph", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/2d67657a18c5868f98311db6b3b8cfb3", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-write-chunk-1", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-1-1", + "c0-write-mention-1-2" + ] + }, + { + "chunkId": "c0-write-chunk-2", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-2-1", + "c0-write-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/9747dc2e989b444a83bc8dd8ef311531", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-write-chunk-1", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-1-1", + "c0-write-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/f2476075119c3ad93fbdff5b0616c6c9", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-write-chunk-2", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-2-1", + "c0-write-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/e96c66c19d9a46f9c58083683f9abe08", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-write-chunk-3", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-3-1", + "c0-write-mention-3-2" + ] + }, + { + "chunkId": "c0-write-chunk-4", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-4-1", + "c0-write-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/55295e180e07d4e2e741b442f49caee8", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-write-chunk-3", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-3-1", + "c0-write-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/90aa33c30c340bfe831bba666767ff80", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-write-chunk-4", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-4-1", + "c0-write-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/a98dce08a3e22266052cd67d8443ec93", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-write-chunk-5", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-5-1", + "c0-write-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/b3af16a82c041e7200fb2ebc669d993b", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-write-chunk-5", + "parsedArtifactId": "c0-write-parsed", + "rawArtifactId": "c0-write-raw", + "sourceId": "c0-write-source", + "sourceMentionIds": [ + "c0-write-mention-5-1", + "c0-write-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "write", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "receiptHash": "" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-015.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-015.json new file mode 100644 index 0000000..30840fe --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-015.json @@ -0,0 +1,1094 @@ +[ + { + "step": 1, + "kind": "call", + "name": "submit", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-gate", + "decisionId": "gks:decision/1863de235e3aeee293ec8b0b4cec6958", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "claim", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisions": [ + { + "batchId": "c0-gate", + "chunks": [ + { + "chunkId": "c0-gate-chunk-1", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "endOffset": 25, + "ordinal": 0, + "parsedArtifactId": "c0-gate-parsed", + "startOffset": 0, + "text": "Alice works for Acme Ltd." + }, + { + "chunkId": "c0-gate-chunk-2", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "endOffset": 48, + "ordinal": 1, + "parsedArtifactId": "c0-gate-parsed", + "startOffset": 26, + "text": "Alice purchased Atlas." + }, + { + "chunkId": "c0-gate-chunk-3", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "endOffset": 74, + "ordinal": 2, + "parsedArtifactId": "c0-gate-parsed", + "startOffset": 49, + "text": "Bob works for Beacon Ltd." + }, + { + "chunkId": "c0-gate-chunk-4", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "endOffset": 96, + "ordinal": 3, + "parsedArtifactId": "c0-gate-parsed", + "startOffset": 75, + "text": "Bob purchased Nimbus." + }, + { + "chunkId": "c0-gate-chunk-5", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "endOffset": 123, + "ordinal": 4, + "parsedArtifactId": "c0-gate-parsed", + "startOffset": 97, + "text": "Carol works for Cedar Ltd." + } + ], + "decisionHash": "", + "decisionId": "gks:decision/1863de235e3aeee293ec8b0b4cec6958", + "derived": [], + "entities": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "mentions": [ + "c0-gate-mention-1-1", + "c0-gate-mention-2-1" + ], + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "name": "Alice", + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "mentions": [ + "c0-gate-mention-1-2" + ], + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "name": "Acme Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "mentions": [ + "c0-gate-mention-2-2" + ], + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "name": "Atlas", + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "mentions": [ + "c0-gate-mention-3-1", + "c0-gate-mention-4-1" + ], + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "name": "Bob", + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "mentions": [ + "c0-gate-mention-3-2" + ], + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "name": "Beacon Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "mentions": [ + "c0-gate-mention-4-2" + ], + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "name": "Nimbus", + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "mentions": [ + "c0-gate-mention-5-1" + ], + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "name": "Carol", + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "mentions": [ + "c0-gate-mention-5-2" + ], + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "name": "Cedar Ltd.", + "semanticType": "Organization" + } + ], + "expectedGraphReadback": { + "edgeCount": 26, + "nodeCount": 20 + }, + "facts": [ + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/b281674a8657f11da014b2b0d35bf0c5", + "objectId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-gate-chunk-1", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-1-1", + "c0-gate-mention-1-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/8bbd526ddb82fa9520db3c0a58fc87b9", + "objectId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-gate-chunk-2", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-2-1", + "c0-gate-mention-2-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/d243308663ab617c92287071655c1d17", + "objectId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-gate-chunk-3", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-3-1", + "c0-gate-mention-3-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/353a0a576dbbf2280de0059400c155f6", + "objectId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-gate-chunk-4", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-4-1", + "c0-gate-mention-4-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/bdb57bba29fba45a6e9d328376c0d38c", + "objectId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-gate-chunk-5", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-5-1", + "c0-gate-mention-5-2" + ] + }, + "subjectId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + } + ], + "graph": { + "edges": [ + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/b281674a8657f11da014b2b0d35bf0c5", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-gate-chunk-1", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-1-1", + "c0-gate-mention-1-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef" + }, + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/8bbd526ddb82fa9520db3c0a58fc87b9", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-gate-chunk-2", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-2-1", + "c0-gate-mention-2-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/d243308663ab617c92287071655c1d17", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-gate-chunk-3", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-3-1", + "c0-gate-mention-3-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/353a0a576dbbf2280de0059400c155f6", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-gate-chunk-4", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-4-1", + "c0-gate-mention-4-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637" + }, + { + "confidence": 0.9, + "from": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "id": "gks:fact/bdb57bba29fba45a6e9d328376c0d38c", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-gate-chunk-5", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-5-1", + "c0-gate-mention-5-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/cedar-1580060aacced42afb786146c028fed1" + } + ], + "nodes": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "semanticType": "Organization" + } + ] + }, + "held": [], + "mentions": [ + { + "chunkId": "c0-gate-chunk-1", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-gate-mention-1-1", + "startOffset": 0 + }, + { + "chunkId": "c0-gate-chunk-1", + "endOffset": 25, + "name": "Acme Ltd.", + "resolutionKey": "acme", + "semanticType": "Organization", + "sourceMentionId": "c0-gate-mention-1-2", + "startOffset": 16 + }, + { + "chunkId": "c0-gate-chunk-2", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-gate-mention-2-1", + "startOffset": 0 + }, + { + "chunkId": "c0-gate-chunk-2", + "endOffset": 21, + "name": "Atlas", + "resolutionKey": "atlas", + "semanticType": "Product", + "sourceMentionId": "c0-gate-mention-2-2", + "startOffset": 16 + }, + { + "chunkId": "c0-gate-chunk-3", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-gate-mention-3-1", + "startOffset": 0 + }, + { + "chunkId": "c0-gate-chunk-3", + "endOffset": 25, + "name": "Beacon Ltd.", + "resolutionKey": "beacon", + "semanticType": "Organization", + "sourceMentionId": "c0-gate-mention-3-2", + "startOffset": 14 + }, + { + "chunkId": "c0-gate-chunk-4", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-gate-mention-4-1", + "startOffset": 0 + }, + { + "chunkId": "c0-gate-chunk-4", + "endOffset": 20, + "name": "Nimbus", + "resolutionKey": "nimbus", + "semanticType": "Product", + "sourceMentionId": "c0-gate-mention-4-2", + "startOffset": 14 + }, + { + "chunkId": "c0-gate-chunk-5", + "endOffset": 5, + "name": "Carol", + "resolutionKey": "carol", + "semanticType": "Person", + "sourceMentionId": "c0-gate-mention-5-1", + "startOffset": 0 + }, + { + "chunkId": "c0-gate-chunk-5", + "endOffset": 26, + "name": "Cedar Ltd.", + "resolutionKey": "cedar", + "semanticType": "Organization", + "sourceMentionId": "c0-gate-mention-5-2", + "startOffset": 16 + } + ], + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "runId": "c0-gate-run", + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "source": { + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd.", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "documentId": "c0-gate-document", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "version": "1" + }, + "stageMetrics": { + "9": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0 + }, + "10": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "11": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "12": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "unmapped": 0 + }, + "13": { + "records_in": 13, + "records_out": 5, + "records_quarantined": 0 + }, + "14": { + "records_in": 8, + "records_out": 0, + "records_quarantined": 0 + } + }, + "stages": [ + { + "attemptId": "c0-gate-attempt-9", + "executionStepId": "c0-gate-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-gate-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-gate-attempt-10", + "executionStepId": "c0-gate-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-gate-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-gate-attempt-11", + "executionStepId": "c0-gate-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-gate-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-gate-attempt-12", + "executionStepId": "c0-gate-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-gate-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-gate-attempt-13", + "executionStepId": "c0-gate-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-gate-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-gate-attempt-14", + "executionStepId": "c0-gate-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-gate-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-gate-attempt-15", + "executionStepId": "c0-gate-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-gate-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-gate-attempt-16", + "executionStepId": "c0-gate-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-gate-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-gate-attempt-17", + "executionStepId": "c0-gate-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-gate-run", + "stageNumber": 17 + } + ] + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "graph", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/98541ed8aeb09b4ade7ed7f0c22473d5", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-gate-chunk-1", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-1-1", + "c0-gate-mention-1-2" + ] + }, + { + "chunkId": "c0-gate-chunk-2", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-2-1", + "c0-gate-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/3c1661e19e521421e7d4f4f3e0df584b", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-gate-chunk-1", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-1-1", + "c0-gate-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/530709d75a38186d5d61c5e91d814db5", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-gate-chunk-2", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-2-1", + "c0-gate-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/de8ad7015b02e6c51025b7229d747fc6", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-gate-chunk-3", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-3-1", + "c0-gate-mention-3-2" + ] + }, + { + "chunkId": "c0-gate-chunk-4", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-4-1", + "c0-gate-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/7f885fce8edaca753732c5fcb57ae881", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-gate-chunk-3", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-3-1", + "c0-gate-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/d0deec6ff3d10f224bbf6071e7580fcc", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-gate-chunk-4", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-4-1", + "c0-gate-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/d3a12dbb587fb91f3cdc4ca27e27ae73", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-gate-chunk-5", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-5-1", + "c0-gate-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/186fc2f4308a425e79c115c9dcee65a5", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-gate-chunk-5", + "parsedArtifactId": "c0-gate-parsed", + "rawArtifactId": "c0-gate-raw", + "sourceId": "c0-gate-source", + "sourceMentionIds": [ + "c0-gate-mention-5-1", + "c0-gate-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "write", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "receiptHash": "" + } + } + } + }, + { + "step": 5, + "kind": "call", + "name": "gate", + "response": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "verdict": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-gate-run", + "decisionId": "gks:decision/1863de235e3aeee293ec8b0b4cec6958", + "decisionHash": "", + "snapshotId": "c0-gate-snapshot", + "generation": "c0-gate-generation", + "receiptHash": "", + "verdict": "PASS", + "allowPublication": true, + "dimensions": { + "data": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "graph": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "knowledge": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "security": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "retrieval": { + "result": "PASS", + "critical": false, + "reasons": [] + } + }, + "statistics": { + "documents": 1, + "chunks": 5, + "entities": 8, + "facts": 5, + "relations": 5 + }, + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1" + }, + "verdictHash": "" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-016.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-016.json new file mode 100644 index 0000000..276beb6 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-016.json @@ -0,0 +1,1125 @@ +[ + { + "step": 1, + "kind": "call", + "name": "submit", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-publication", + "decisionId": "gks:decision/fc9c8fe58efaa42f511dc31cb3bad177", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "claim", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisions": [ + { + "batchId": "c0-publication", + "chunks": [ + { + "chunkId": "c0-publication-chunk-1", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "endOffset": 25, + "ordinal": 0, + "parsedArtifactId": "c0-publication-parsed", + "startOffset": 0, + "text": "Alice works for Acme Ltd." + }, + { + "chunkId": "c0-publication-chunk-2", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "endOffset": 48, + "ordinal": 1, + "parsedArtifactId": "c0-publication-parsed", + "startOffset": 26, + "text": "Alice purchased Atlas." + }, + { + "chunkId": "c0-publication-chunk-3", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "endOffset": 74, + "ordinal": 2, + "parsedArtifactId": "c0-publication-parsed", + "startOffset": 49, + "text": "Bob works for Beacon Ltd." + }, + { + "chunkId": "c0-publication-chunk-4", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "endOffset": 96, + "ordinal": 3, + "parsedArtifactId": "c0-publication-parsed", + "startOffset": 75, + "text": "Bob purchased Nimbus." + }, + { + "chunkId": "c0-publication-chunk-5", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "endOffset": 123, + "ordinal": 4, + "parsedArtifactId": "c0-publication-parsed", + "startOffset": 97, + "text": "Carol works for Cedar Ltd." + } + ], + "decisionHash": "", + "decisionId": "gks:decision/fc9c8fe58efaa42f511dc31cb3bad177", + "derived": [], + "entities": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "mentions": [ + "c0-publication-mention-1-1", + "c0-publication-mention-2-1" + ], + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "name": "Alice", + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "mentions": [ + "c0-publication-mention-1-2" + ], + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "name": "Acme Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "mentions": [ + "c0-publication-mention-2-2" + ], + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "name": "Atlas", + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "mentions": [ + "c0-publication-mention-3-1", + "c0-publication-mention-4-1" + ], + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "name": "Bob", + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "mentions": [ + "c0-publication-mention-3-2" + ], + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "name": "Beacon Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "mentions": [ + "c0-publication-mention-4-2" + ], + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "name": "Nimbus", + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "mentions": [ + "c0-publication-mention-5-1" + ], + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "name": "Carol", + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "mentions": [ + "c0-publication-mention-5-2" + ], + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "name": "Cedar Ltd.", + "semanticType": "Organization" + } + ], + "expectedGraphReadback": { + "edgeCount": 26, + "nodeCount": 20 + }, + "facts": [ + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/08d5776a8765e2b9dcdc7c2ce0bc9e88", + "objectId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-publication-chunk-1", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-1-1", + "c0-publication-mention-1-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/b4b931915ac3116cdaa1045d38520e32", + "objectId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-publication-chunk-2", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-2-1", + "c0-publication-mention-2-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/0e73302ed706ce274a14d0ea427e6dd7", + "objectId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-publication-chunk-3", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-3-1", + "c0-publication-mention-3-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/b1d9a8758a6fd4721f8f0136c4ed847f", + "objectId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-publication-chunk-4", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-4-1", + "c0-publication-mention-4-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/941a977062a1c16f7994ae482c0618d1", + "objectId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-publication-chunk-5", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-5-1", + "c0-publication-mention-5-2" + ] + }, + "subjectId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + } + ], + "graph": { + "edges": [ + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/08d5776a8765e2b9dcdc7c2ce0bc9e88", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-publication-chunk-1", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-1-1", + "c0-publication-mention-1-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef" + }, + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/b4b931915ac3116cdaa1045d38520e32", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-publication-chunk-2", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-2-1", + "c0-publication-mention-2-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/0e73302ed706ce274a14d0ea427e6dd7", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-publication-chunk-3", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-3-1", + "c0-publication-mention-3-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/b1d9a8758a6fd4721f8f0136c4ed847f", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-publication-chunk-4", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-4-1", + "c0-publication-mention-4-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637" + }, + { + "confidence": 0.9, + "from": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "id": "gks:fact/941a977062a1c16f7994ae482c0618d1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-publication-chunk-5", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-5-1", + "c0-publication-mention-5-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/cedar-1580060aacced42afb786146c028fed1" + } + ], + "nodes": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "semanticType": "Organization" + } + ] + }, + "held": [], + "mentions": [ + { + "chunkId": "c0-publication-chunk-1", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-publication-mention-1-1", + "startOffset": 0 + }, + { + "chunkId": "c0-publication-chunk-1", + "endOffset": 25, + "name": "Acme Ltd.", + "resolutionKey": "acme", + "semanticType": "Organization", + "sourceMentionId": "c0-publication-mention-1-2", + "startOffset": 16 + }, + { + "chunkId": "c0-publication-chunk-2", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-publication-mention-2-1", + "startOffset": 0 + }, + { + "chunkId": "c0-publication-chunk-2", + "endOffset": 21, + "name": "Atlas", + "resolutionKey": "atlas", + "semanticType": "Product", + "sourceMentionId": "c0-publication-mention-2-2", + "startOffset": 16 + }, + { + "chunkId": "c0-publication-chunk-3", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-publication-mention-3-1", + "startOffset": 0 + }, + { + "chunkId": "c0-publication-chunk-3", + "endOffset": 25, + "name": "Beacon Ltd.", + "resolutionKey": "beacon", + "semanticType": "Organization", + "sourceMentionId": "c0-publication-mention-3-2", + "startOffset": 14 + }, + { + "chunkId": "c0-publication-chunk-4", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-publication-mention-4-1", + "startOffset": 0 + }, + { + "chunkId": "c0-publication-chunk-4", + "endOffset": 20, + "name": "Nimbus", + "resolutionKey": "nimbus", + "semanticType": "Product", + "sourceMentionId": "c0-publication-mention-4-2", + "startOffset": 14 + }, + { + "chunkId": "c0-publication-chunk-5", + "endOffset": 5, + "name": "Carol", + "resolutionKey": "carol", + "semanticType": "Person", + "sourceMentionId": "c0-publication-mention-5-1", + "startOffset": 0 + }, + { + "chunkId": "c0-publication-chunk-5", + "endOffset": 26, + "name": "Cedar Ltd.", + "resolutionKey": "cedar", + "semanticType": "Organization", + "sourceMentionId": "c0-publication-mention-5-2", + "startOffset": 16 + } + ], + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "runId": "c0-publication-run", + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "source": { + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd.", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "documentId": "c0-publication-document", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "version": "1" + }, + "stageMetrics": { + "9": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0 + }, + "10": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "11": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "12": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "unmapped": 0 + }, + "13": { + "records_in": 13, + "records_out": 5, + "records_quarantined": 0 + }, + "14": { + "records_in": 8, + "records_out": 0, + "records_quarantined": 0 + } + }, + "stages": [ + { + "attemptId": "c0-publication-attempt-9", + "executionStepId": "c0-publication-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-publication-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-publication-attempt-10", + "executionStepId": "c0-publication-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-publication-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-publication-attempt-11", + "executionStepId": "c0-publication-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-publication-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-publication-attempt-12", + "executionStepId": "c0-publication-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-publication-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-publication-attempt-13", + "executionStepId": "c0-publication-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-publication-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-publication-attempt-14", + "executionStepId": "c0-publication-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-publication-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-publication-attempt-15", + "executionStepId": "c0-publication-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-publication-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-publication-attempt-16", + "executionStepId": "c0-publication-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-publication-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-publication-attempt-17", + "executionStepId": "c0-publication-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-publication-run", + "stageNumber": 17 + } + ] + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "graph", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/1172462bb3c1401eb74775182978c61d", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-publication-chunk-1", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-1-1", + "c0-publication-mention-1-2" + ] + }, + { + "chunkId": "c0-publication-chunk-2", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-2-1", + "c0-publication-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/81e08035eec1435860e1f7a109fefabb", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-publication-chunk-1", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-1-1", + "c0-publication-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/7ae6f4c8bf3b31bb111e1fac040c96d0", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-publication-chunk-2", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-2-1", + "c0-publication-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/586964f0803626798f1df103559bdf51", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-publication-chunk-3", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-3-1", + "c0-publication-mention-3-2" + ] + }, + { + "chunkId": "c0-publication-chunk-4", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-4-1", + "c0-publication-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/7c57caf1175261836dfa2ae59b131cf1", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-publication-chunk-3", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-3-1", + "c0-publication-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/2e454ac8ac40899affa03acb016ffd59", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-publication-chunk-4", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-4-1", + "c0-publication-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/1a9ad6195ffafb3e69ef207b994053a0", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-publication-chunk-5", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-5-1", + "c0-publication-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/6533c4194cec36f28abc909f048e8fbe", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-publication-chunk-5", + "parsedArtifactId": "c0-publication-parsed", + "rawArtifactId": "c0-publication-raw", + "sourceId": "c0-publication-source", + "sourceMentionIds": [ + "c0-publication-mention-5-1", + "c0-publication-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "write", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "receiptHash": "" + } + } + } + }, + { + "step": 5, + "kind": "call", + "name": "gate", + "response": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "verdict": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-publication-run", + "decisionId": "gks:decision/fc9c8fe58efaa42f511dc31cb3bad177", + "decisionHash": "", + "snapshotId": "c0-publication-snapshot", + "generation": "c0-publication-generation", + "receiptHash": "", + "verdict": "PASS", + "allowPublication": true, + "dimensions": { + "data": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "graph": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "knowledge": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "security": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "retrieval": { + "result": "PASS", + "critical": false, + "reasons": [] + } + }, + "statistics": { + "documents": 1, + "chunks": 5, + "entities": 8, + "facts": 5, + "relations": 5 + }, + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1" + }, + "verdictHash": "" + } + } + } + }, + { + "step": 6, + "kind": "call", + "name": "publication", + "response": { + "jsonrpc": "2.0", + "id": 6, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "publicationHash": "" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TOOL-017.json b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-017.json new file mode 100644 index 0000000..c3ecce2 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TOOL-017.json @@ -0,0 +1,1577 @@ +[ + { + "step": 1, + "kind": "call", + "name": "submit", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "batchId": "c0-evidence", + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "status": "PENDING", + "idempotent": false + } + } + } + }, + { + "step": 2, + "kind": "call", + "name": "claim", + "response": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "decisions": [ + { + "batchId": "c0-evidence", + "chunks": [ + { + "chunkId": "c0-evidence-chunk-1", + "contentHash": "c0d7514564bbcdd5dfa3beb8823955437e0fc20d708d3a826cedd02a5b4d518c", + "endOffset": 25, + "ordinal": 0, + "parsedArtifactId": "c0-evidence-parsed", + "startOffset": 0, + "text": "Alice works for Acme Ltd." + }, + { + "chunkId": "c0-evidence-chunk-2", + "contentHash": "936fc7235133947fc6eb15157f76115945dbf3d53558ef5d02083f6f49fbada9", + "endOffset": 48, + "ordinal": 1, + "parsedArtifactId": "c0-evidence-parsed", + "startOffset": 26, + "text": "Alice purchased Atlas." + }, + { + "chunkId": "c0-evidence-chunk-3", + "contentHash": "cc900b0204ad4e3f5de47590f3740c7b8a9ee5db7b4362d68c98069d285a8aac", + "endOffset": 74, + "ordinal": 2, + "parsedArtifactId": "c0-evidence-parsed", + "startOffset": 49, + "text": "Bob works for Beacon Ltd." + }, + { + "chunkId": "c0-evidence-chunk-4", + "contentHash": "da1bf96e80de46bfaa7ea63ae9a430f95efc28853943fb14218dbe0c44c6a1ba", + "endOffset": 96, + "ordinal": 3, + "parsedArtifactId": "c0-evidence-parsed", + "startOffset": 75, + "text": "Bob purchased Nimbus." + }, + { + "chunkId": "c0-evidence-chunk-5", + "contentHash": "7c895c367fc4817e1d76f13b5d3fa76259376a4f0116cf3c5ce23962719aefdc", + "endOffset": 123, + "ordinal": 4, + "parsedArtifactId": "c0-evidence-parsed", + "startOffset": 97, + "text": "Carol works for Cedar Ltd." + } + ], + "decisionHash": "", + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "derived": [], + "entities": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "mentions": [ + "c0-evidence-mention-1-1", + "c0-evidence-mention-2-1" + ], + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "name": "Alice", + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "mentions": [ + "c0-evidence-mention-1-2" + ], + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "name": "Acme Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "mentions": [ + "c0-evidence-mention-2-2" + ], + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "name": "Atlas", + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "mentions": [ + "c0-evidence-mention-3-1", + "c0-evidence-mention-4-1" + ], + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "name": "Bob", + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "mentions": [ + "c0-evidence-mention-3-2" + ], + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "name": "Beacon Ltd.", + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "mentions": [ + "c0-evidence-mention-4-2" + ], + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "name": "Nimbus", + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "mentions": [ + "c0-evidence-mention-5-1" + ], + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "name": "Carol", + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "mentions": [ + "c0-evidence-mention-5-2" + ], + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "name": "Cedar Ltd.", + "semanticType": "Organization" + } + ], + "expectedGraphReadback": { + "edgeCount": 26, + "nodeCount": 20 + }, + "facts": [ + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/e3867a7f4c28e683ce2ed38b3b76e525", + "objectId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-1", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-1-1", + "c0-evidence-mention-1-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/656f25894c6f6c23d1892aed5b6abd94", + "objectId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-2", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-2-1", + "c0-evidence-mention-2-2" + ] + }, + "subjectId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/574a3749e59046bf7b89f2cbbd33f99c", + "objectId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-3", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-3-1", + "c0-evidence-mention-3-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/2c485547b1608b3bcc482b4e1aef4406", + "objectId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "pipelineVersion": "genesisrag17.v1", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-4", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-4-1", + "c0-evidence-mention-4-2" + ] + }, + "subjectId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + }, + { + "basis": "explicit", + "confidence": 0.9, + "id": "gks:fact/0f74c8200a0a28abe492bc69b622a510", + "objectId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "pipelineVersion": "genesisrag17.v1", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-5", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-5-1", + "c0-evidence-mention-5-2" + ] + }, + "subjectId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + } + } + ], + "graph": { + "edges": [ + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/e3867a7f4c28e683ce2ed38b3b76e525", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-1", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-1-1", + "c0-evidence-mention-1-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef" + }, + { + "confidence": 0.9, + "from": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "id": "gks:fact/656f25894c6f6c23d1892aed5b6abd94", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-2", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-2-1", + "c0-evidence-mention-2-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/574a3749e59046bf7b89f2cbbd33f99c", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-3", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-3-1", + "c0-evidence-mention-3-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109" + }, + { + "confidence": 0.9, + "from": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "id": "gks:fact/2c485547b1608b3bcc482b4e1aef4406", + "predicate": "PURCHASED", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-4", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-4-1", + "c0-evidence-mention-4-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637" + }, + { + "confidence": 0.9, + "from": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "id": "gks:fact/0f74c8200a0a28abe492bc69b622a510", + "predicate": "WORKS_FOR", + "sourceReferences": { + "chunkId": "c0-evidence-chunk-5", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-5-1", + "c0-evidence-mention-5-2" + ] + }, + "temporal": { + "txFrom": "", + "txTo": null, + "validFrom": "not_applicable", + "validTo": "not_applicable" + }, + "to": "gks:entity/cedar-1580060aacced42afb786146c028fed1" + } + ], + "nodes": [ + { + "id": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "metadata": { + "resolutionKey": "alice", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "metadata": { + "resolutionKey": "acme", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "metadata": { + "resolutionKey": "atlas", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "metadata": { + "resolutionKey": "bob", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "metadata": { + "resolutionKey": "beacon", + "semanticType": "Organization" + }, + "semanticType": "Organization" + }, + { + "id": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "metadata": { + "resolutionKey": "nimbus", + "semanticType": "Product" + }, + "semanticType": "Product" + }, + { + "id": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "metadata": { + "resolutionKey": "carol", + "semanticType": "Person" + }, + "semanticType": "Person" + }, + { + "id": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "metadata": { + "resolutionKey": "cedar", + "semanticType": "Organization" + }, + "semanticType": "Organization" + } + ] + }, + "held": [], + "mentions": [ + { + "chunkId": "c0-evidence-chunk-1", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-evidence-mention-1-1", + "startOffset": 0 + }, + { + "chunkId": "c0-evidence-chunk-1", + "endOffset": 25, + "name": "Acme Ltd.", + "resolutionKey": "acme", + "semanticType": "Organization", + "sourceMentionId": "c0-evidence-mention-1-2", + "startOffset": 16 + }, + { + "chunkId": "c0-evidence-chunk-2", + "endOffset": 5, + "name": "Alice", + "resolutionKey": "alice", + "semanticType": "Person", + "sourceMentionId": "c0-evidence-mention-2-1", + "startOffset": 0 + }, + { + "chunkId": "c0-evidence-chunk-2", + "endOffset": 21, + "name": "Atlas", + "resolutionKey": "atlas", + "semanticType": "Product", + "sourceMentionId": "c0-evidence-mention-2-2", + "startOffset": 16 + }, + { + "chunkId": "c0-evidence-chunk-3", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-evidence-mention-3-1", + "startOffset": 0 + }, + { + "chunkId": "c0-evidence-chunk-3", + "endOffset": 25, + "name": "Beacon Ltd.", + "resolutionKey": "beacon", + "semanticType": "Organization", + "sourceMentionId": "c0-evidence-mention-3-2", + "startOffset": 14 + }, + { + "chunkId": "c0-evidence-chunk-4", + "endOffset": 3, + "name": "Bob", + "resolutionKey": "bob", + "semanticType": "Person", + "sourceMentionId": "c0-evidence-mention-4-1", + "startOffset": 0 + }, + { + "chunkId": "c0-evidence-chunk-4", + "endOffset": 20, + "name": "Nimbus", + "resolutionKey": "nimbus", + "semanticType": "Product", + "sourceMentionId": "c0-evidence-mention-4-2", + "startOffset": 14 + }, + { + "chunkId": "c0-evidence-chunk-5", + "endOffset": 5, + "name": "Carol", + "resolutionKey": "carol", + "semanticType": "Person", + "sourceMentionId": "c0-evidence-mention-5-1", + "startOffset": 0 + }, + { + "chunkId": "c0-evidence-chunk-5", + "endOffset": 26, + "name": "Cedar Ltd.", + "resolutionKey": "cedar", + "semanticType": "Organization", + "sourceMentionId": "c0-evidence-mention-5-2", + "startOffset": 16 + } + ], + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "policy": { + "allowEmbedding": true, + "allowPublication": true + }, + "runId": "c0-evidence-run", + "schemaVersion": "genesisrag17.v1", + "scope": { + "agentId": "c0-agent", + "businessId": "c0-business", + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "visibility": "private", + "workspaceId": "" + }, + "source": { + "content": "Alice works for Acme Ltd.\nAlice purchased Atlas.\nBob works for Beacon Ltd.\nBob purchased Nimbus.\nCarol works for Cedar Ltd.", + "contentHash": "3d85099fe6eeebd2d69b103c8ea4824dddd4604ccbcef4d1a37da3f8ded2be5a", + "documentId": "c0-evidence-document", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "version": "1" + }, + "stageMetrics": { + "9": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0 + }, + "10": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "11": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0 + }, + "12": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "unmapped": 0 + }, + "13": { + "records_in": 13, + "records_out": 5, + "records_quarantined": 0 + }, + "14": { + "records_in": 8, + "records_out": 0, + "records_quarantined": 0 + } + }, + "stages": [ + { + "attemptId": "c0-evidence-attempt-9", + "executionStepId": "c0-evidence-step-9", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "runId": "c0-evidence-run", + "stageNumber": 9 + }, + { + "attemptId": "c0-evidence-attempt-10", + "executionStepId": "c0-evidence-step-10", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "runId": "c0-evidence-run", + "stageNumber": 10 + }, + { + "attemptId": "c0-evidence-attempt-11", + "executionStepId": "c0-evidence-step-11", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "runId": "c0-evidence-run", + "stageNumber": 11 + }, + { + "attemptId": "c0-evidence-attempt-12", + "executionStepId": "c0-evidence-step-12", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "runId": "c0-evidence-run", + "stageNumber": 12 + }, + { + "attemptId": "c0-evidence-attempt-13", + "executionStepId": "c0-evidence-step-13", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "runId": "c0-evidence-run", + "stageNumber": 13 + }, + { + "attemptId": "c0-evidence-attempt-14", + "executionStepId": "c0-evidence-step-14", + "pipelineStageId": "DPS-KI-ENRICH", + "runId": "c0-evidence-run", + "stageNumber": 14 + }, + { + "attemptId": "c0-evidence-attempt-15", + "executionStepId": "c0-evidence-step-15", + "pipelineStageId": "DPS-KI-EMBED", + "runId": "c0-evidence-run", + "stageNumber": 15 + }, + { + "attemptId": "c0-evidence-attempt-16", + "executionStepId": "c0-evidence-step-16", + "pipelineStageId": "DPS-KI-INDEX", + "runId": "c0-evidence-run", + "stageNumber": 16 + }, + { + "attemptId": "c0-evidence-attempt-17", + "executionStepId": "c0-evidence-step-17", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "runId": "c0-evidence-run", + "stageNumber": 17 + } + ] + } + ] + } + } + } + }, + { + "step": 3, + "kind": "call", + "name": "graph", + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "graphReceiptHash": "", + "derived": [ + { + "id": "gks:derived/45a0a3b409ec65e7e0c90c71575bc111", + "entityId": "gks:entity/alice-321344e6cf7962b89b73205d796f2bda", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-evidence-chunk-1", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-1-1", + "c0-evidence-mention-1-2" + ] + }, + { + "chunkId": "c0-evidence-chunk-2", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-2-1", + "c0-evidence-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/20974dce1eed2d9fde36620e803b7b45", + "entityId": "gks:entity/acme-697877a89d2b26cc08938c6bf7a4baef", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-evidence-chunk-1", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-1-1", + "c0-evidence-mention-1-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/af4cf705465bca767d7a6b83b90a74e6", + "entityId": "gks:entity/atlas-a456a610439b705d648cc5f6680e26d2", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-evidence-chunk-2", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-2-1", + "c0-evidence-mention-2-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/f2577b53e18a65a5f1fe91e7e89a89d5", + "entityId": "gks:entity/bob-e0a858e8585a5dc9e8df50391a7801a3", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 2, + "factCount": 2, + "sourceReferences": [ + { + "chunkId": "c0-evidence-chunk-3", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-3-1", + "c0-evidence-mention-3-2" + ] + }, + { + "chunkId": "c0-evidence-chunk-4", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-4-1", + "c0-evidence-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/347746ef0e04ce4f12606cc867d0041c", + "entityId": "gks:entity/beacon-ccd19a469d98849df13f07398da7e109", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-evidence-chunk-3", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-3-1", + "c0-evidence-mention-3-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/a61dc224ae8ece8603d2b9c054eb014c", + "entityId": "gks:entity/nimbus-fec156ef693ad88b4fa13649d1a48637", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-evidence-chunk-4", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-4-1", + "c0-evidence-mention-4-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/4fa440e9827c5140fea48ec1a6b23748", + "entityId": "gks:entity/carol-8173c572371e40ed3901f0058e4d1f4e", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-evidence-chunk-5", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-5-1", + "c0-evidence-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + }, + { + "id": "gks:derived/3ba1a39cf5f81c34770af1fa1aba8cdb", + "entityId": "gks:entity/cedar-1580060aacced42afb786146c028fed1", + "derivationMethod": "enrich_v1", + "documentCount": 1, + "chunkCount": 1, + "factCount": 1, + "sourceReferences": [ + { + "chunkId": "c0-evidence-chunk-5", + "parsedArtifactId": "c0-evidence-parsed", + "rawArtifactId": "c0-evidence-raw", + "sourceId": "c0-evidence-source", + "sourceMentionIds": [ + "c0-evidence-mention-5-1", + "c0-evidence-mention-5-2" + ] + } + ], + "pipelineVersion": "genesisrag17.v1", + "generatedAt": "" + } + ], + "derivedHash": "" + } + } + } + }, + { + "step": 4, + "kind": "call", + "name": "write", + "response": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "receiptHash": "" + } + } + } + }, + { + "step": 5, + "kind": "call", + "name": "gate", + "response": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "verdict": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "decisionHash": "", + "snapshotId": "c0-evidence-snapshot", + "generation": "c0-evidence-generation", + "receiptHash": "", + "verdict": "PASS", + "allowPublication": true, + "dimensions": { + "data": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "graph": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "knowledge": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "security": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "retrieval": { + "result": "PASS", + "critical": false, + "reasons": [] + } + }, + "statistics": { + "documents": 1, + "chunks": 5, + "entities": 8, + "facts": 5, + "relations": 5 + }, + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1" + }, + "verdictHash": "" + } + } + } + }, + { + "step": 6, + "kind": "call", + "name": "publication", + "response": { + "jsonrpc": "2.0", + "id": 6, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "accepted": true, + "idempotent": false, + "publicationHash": "" + } + } + } + }, + { + "step": 7, + "kind": "call", + "name": "evidence", + "response": { + "jsonrpc": "2.0", + "id": 7, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "rows": [ + { + "cursor": 1, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "pipelineStageId": "DPS-KI-ENTITY-RESOLVE", + "executionStepId": "c0-evidence-step-9", + "attemptId": "c0-evidence-attempt-9", + "stageNumber": 9, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 10, + "records_out": 8, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-evidence", + "decisionHash": "", + "stageNumber": 9, + "records": 8 + } + }, + { + "cursor": 2, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "pipelineStageId": "DPS-KI-FACT-EXTRACT", + "executionStepId": "c0-evidence-step-10", + "attemptId": "c0-evidence-attempt-10", + "stageNumber": 10, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-evidence", + "decisionHash": "", + "stageNumber": 10, + "records": 5 + } + }, + { + "cursor": 3, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "pipelineStageId": "DPS-KI-ONTOLOGY-MAP", + "executionStepId": "c0-evidence-step-11", + "attemptId": "c0-evidence-attempt-11", + "stageNumber": 11, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-evidence", + "decisionHash": "", + "stageNumber": 11, + "records": 5 + } + }, + { + "cursor": 4, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "pipelineStageId": "DPS-KI-TEMPORAL-MAP", + "executionStepId": "c0-evidence-step-12", + "attemptId": "c0-evidence-attempt-12", + "stageNumber": 12, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "batchId": "c0-evidence", + "decisionHash": "", + "stageNumber": 12, + "records": 5 + } + }, + { + "cursor": 5, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "pipelineStageId": "DPS-KI-GRAPH-BUILD", + "executionStepId": "c0-evidence-step-13", + "attemptId": "c0-evidence-attempt-13", + "stageNumber": 13, + "outcome": "SUCCEEDED", + "startedAt": "2026-09-07T15:00:00.000Z", + "finishedAt": "2026-09-07T15:00:00.100Z", + "metrics": { + "records_in": 20, + "records_out": 26, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "graphReceiptHash": "", + "nodeCount": 20, + "edgeCount": 26 + } + }, + { + "cursor": 6, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "pipelineStageId": "DPS-KI-ENRICH", + "executionStepId": "c0-evidence-step-14", + "attemptId": "c0-evidence-attempt-14", + "stageNumber": 14, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 8, + "records_out": 8, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "derivedHash": "", + "derivedCount": 8, + "documentCount": 8, + "chunkCount": 10, + "factCount": 10 + } + }, + { + "cursor": 7, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "pipelineStageId": "DPS-KI-EMBED", + "executionStepId": "c0-evidence-step-15", + "attemptId": "c0-evidence-attempt-15", + "stageNumber": 15, + "outcome": "SUCCEEDED", + "startedAt": "2026-09-07T15:00:01.000Z", + "finishedAt": "2026-09-07T15:00:01.100Z", + "metrics": { + "records_in": 5, + "records_out": 5, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "receiptHash": "", + "stageNumber": 15, + "readback": { + "ok": true, + "nodeCount": 28, + "edgeCount": 44, + "vectorCount": 5, + "citationCount": 5 + }, + "laneStatuses": { + "vector": "ready", + "lexical": "ready", + "graph": "ready", + "sqlite": "ready", + "bitemporal": "not_applicable", + "provenance": "ready" + } + } + }, + { + "cursor": 8, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "pipelineStageId": "DPS-KI-INDEX", + "executionStepId": "c0-evidence-step-16", + "attemptId": "c0-evidence-attempt-16", + "stageNumber": 16, + "outcome": "SUCCEEDED", + "startedAt": "2026-09-07T15:00:02.000Z", + "finishedAt": "2026-09-07T15:00:02.100Z", + "metrics": { + "records_in": 72, + "records_out": 72, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "receiptHash": "", + "stageNumber": 16, + "readback": { + "ok": true, + "nodeCount": 28, + "edgeCount": 44, + "vectorCount": 5, + "citationCount": 5 + }, + "laneStatuses": { + "vector": "ready", + "lexical": "ready", + "graph": "ready", + "sqlite": "ready", + "bitemporal": "not_applicable", + "provenance": "ready" + } + } + }, + { + "cursor": 9, + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "pipelineStageId": "DPS-KI-QUALITY-GATE", + "executionStepId": "c0-evidence-step-17", + "attemptId": "c0-evidence-attempt-17", + "stageNumber": 17, + "outcome": "SUCCEEDED", + "startedAt": "", + "finishedAt": "", + "metrics": { + "records_in": 26, + "records_out": 1, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "details": { + "verdict": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "decisionHash": "", + "snapshotId": "c0-evidence-snapshot", + "generation": "c0-evidence-generation", + "receiptHash": "", + "verdict": "PASS", + "allowPublication": true, + "dimensions": { + "data": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "graph": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "knowledge": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "security": { + "result": "PASS", + "critical": false, + "reasons": [] + }, + "retrieval": { + "result": "PASS", + "critical": false, + "reasons": [] + } + }, + "statistics": { + "documents": 1, + "chunks": 5, + "entities": 8, + "facts": 5, + "relations": 5 + }, + "ontologyVersion": "ontology_v2", + "pipelineVersion": "genesisrag17.v1", + "metrics": { + "records_in": 26, + "records_out": 1, + "records_quarantined": 0, + "error_count": 0, + "retry_count": 0, + "duration_ms": "" + }, + "gateStartedAt": "", + "gateFinishedAt": "" + }, + "publicationReceipt": { + "schemaVersion": "genesisrag17.v1", + "scope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "runId": "c0-evidence-run", + "decisionId": "gks:decision/688bd5d88f0da4188a28e968d68ea143", + "decisionHash": "", + "snapshotId": "c0-evidence-snapshot", + "generation": "c0-evidence-generation", + "receiptHash": "", + "publishedAt": "2026-09-07T15:00:03.000Z", + "pointerHash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "modelRevision": "614241f622f53c4eeff9890bdc4f31cfecc418b3", + "transactionFrontier": "c0-evidence-final-frontier", + "readback": { + "ok": true + } + } + } + } + ], + "nextCursor": 9 + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/expected/C0.4-TRANSPORT-DENIAL.json b/tests/fixtures/c0-qualification/expected/C0.4-TRANSPORT-DENIAL.json new file mode 100644 index 0000000..78c78a7 --- /dev/null +++ b/tests/fixtures/c0-qualification/expected/C0.4-TRANSPORT-DENIAL.json @@ -0,0 +1,117 @@ +[ + { + "step": 1, + "kind": "raw", + "response": { + "jsonrpc": "2.0", + "id": null, + "error": { + "code": -32700, + "message": "Parse error." + } + } + }, + { + "step": 2, + "kind": "raw", + "response": { + "jsonrpc": "2.0", + "id": null, + "error": { + "code": -32600, + "message": "Duplicate JSON object key: method." + } + } + }, + { + "step": 3, + "kind": "raw", + "response": { + "jsonrpc": "2.0", + "id": null, + "error": { + "code": -32600, + "message": "JSON-RPC batch requests are unsupported." + } + } + }, + { + "step": 4, + "kind": "raw", + "response": { + "jsonrpc": "2.0", + "id": null, + "error": { + "code": -32600, + "message": "JSON depth exceeds the configured limit." + } + } + }, + { + "step": 5, + "kind": "raw", + "response": { + "jsonrpc": "2.0", + "id": 4, + "error": { + "code": -32600, + "message": "Request frame exceeds the configured limit." + } + } + }, + { + "step": 6, + "kind": "raw", + "response": { + "jsonrpc": "2.0", + "id": null, + "error": { + "code": -32700, + "message": "Request frame is not valid UTF-8." + } + } + }, + { + "step": 7, + "kind": "raw", + "response": { + "jsonrpc": "2.0", + "id": null, + "error": { + "code": -32600, + "message": "Unsafe or non-finite JSON number." + } + } + }, + { + "step": 8, + "kind": "store-query", + "rows": [ + { + "promotions": 0 + } + ] + }, + { + "step": 9, + "kind": "call", + "name": "alive", + "response": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "content": [ + { + "type": "text", + "text": "" + } + ], + "structuredContent": { + "service": "gks", + "state": "ready", + "graphVersion": "gks:graph/0" + } + } + } + } +] diff --git a/tests/fixtures/c0-qualification/registry.json b/tests/fixtures/c0-qualification/registry.json index 7a66bbb..33dbe64 100644 --- a/tests/fixtures/c0-qualification/registry.json +++ b/tests/fixtures/c0-qualification/registry.json @@ -1,8 +1,14 @@ { - "registryVersion": "c0-qualification/v1", + "registryVersion": "c0-qualification/v2", + "supersedes": "c0-qualification/v1", "fixtureId": "gks-c0.4-golden", "profile": "C0.4", - "statusVocabulary": ["PASS", "FAIL", "NOT_RUN", "BLOCKED"], + "statusVocabulary": [ + "PASS", + "FAIL", + "NOT_RUN", + "BLOCKED" + ], "categories": [ "tool", "api-010-replay", @@ -16,7 +22,10 @@ "provenance": { "adr": "docs/ADR-GKS-C0-QUALIFICATION.md", "toolDefinitions": "packages/gks-contracts/src/tool-definitions.mjs", - "runtime": "fixture-only", + "builder": "scripts/c0-corpus/build-cases.mjs", + "runner": "scripts/run-c0-corpus.mjs", + "runtime": "gks-server stdio process, fresh SQLite store per case", + "normalization": "server-clock instants, measured durations and clock-derived hashes are replaced by stable labels before hashing", "containsSecrets": false, "externalEndpoints": false }, @@ -24,307 +33,977 @@ { "id": "C0.4-TOOL-001", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_health", - "status": "NOT_RUN", - "requestSha256": "c6c824da2637fe0b8a5663a51e37bce16c308c508061c63890704cef5cc86794", - "expectedResultSha256": "ee8ce2fdfb50b7623d7ff97c044ebf8b672f235356f1606c6bd1aca4c73ac420", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-001.json", + "expectedResult": "expected/C0.4-TOOL-001.json", + "requestSha256": "c127c6543b74fe6e35ee078b73b1210aa7fb33131051a6f44cd03c24532746fd", + "expectedResultSha256": "812225259f9b3e5fa4cfb90b213bf7170d11bda82bb6457b36dfdfe3a9cf4ac8", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-002", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_knowledge_promote", - "status": "NOT_RUN", - "requestSha256": "ba944cca88c39c23cf745451e70a64845d5b44073a95772f6589193b8c932002", - "expectedResultSha256": "e91576555e628647e44dbcc51897430bf41ec5b28a4fa356ddc2b1bf5684cc2d", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-002.json", + "expectedResult": "expected/C0.4-TOOL-002.json", + "requestSha256": "66bd6557105c27edff6ba9f5d9f2650569ea064b0c300e2cd27339d9bfb6db6c", + "expectedResultSha256": "5501184b7d3ec421930fc1611178400a38c2416549970fff8010051e2a10bc87", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-003", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_search", - "status": "NOT_RUN", - "requestSha256": "1d9c634d647d4c5e6337ee8ad9c853780ec72a053ff6ac7f8f675293d3d88f50", - "expectedResultSha256": "ebc72e2e44216e2c0db21cc8085a7c83de927f012c1ed87fdbbee7520780f985", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-003.json", + "expectedResult": "expected/C0.4-TOOL-003.json", + "requestSha256": "7e15e2c04f040ee265aa687deec3480984d359bcdb2021bdc7839b74dc8aa24f", + "expectedResultSha256": "20ae22ffd2c33000c3acc65db516f2181f0e7ab49c471fba82544a6516f7beb2", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-004", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_entity_get", - "status": "NOT_RUN", - "requestSha256": "7905bbc009dafad200eac20aecfa93d78e2c7415648f1ebd0e656856379b485d", - "expectedResultSha256": "ef43405d7e6af3fb3eacf1af8dec9212d24a068739441aa35c6b6a7c69efd930", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-004.json", + "expectedResult": "expected/C0.4-TOOL-004.json", + "requestSha256": "bb49cd2d5e1aa96fea7f907400af00fccdd922096a38d4227676e09b329539e7", + "expectedResultSha256": "eb1226a0cd7cfb119b58fc5f263ae4659c126bbe4bb8086114dcf5085b3bc3e7", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-005", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_relations_get", - "status": "NOT_RUN", - "requestSha256": "85050d92643922d4089884ca5d9f44f80a0c3c2a1fa2b6c584e822afb9cf7df1", - "expectedResultSha256": "ad27365cbf8a44d95378429546874e2553fab4ceb074284eb1db10fad601a1d0", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-005.json", + "expectedResult": "expected/C0.4-TOOL-005.json", + "requestSha256": "924a13c1cbb77b4a1e99513d9445a261faf599ec88c4024c4d60f8198331f326", + "expectedResultSha256": "e856973f4713a6d4d8a714afbb5f5633af2a0b25c75817dd13e821e57bb15149", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-006", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_artifact_link", - "status": "NOT_RUN", - "requestSha256": "6a6c22a75d302f5b4535ae1257b57e18a21d971710f41ef26ed15b5b5ec134cb", - "expectedResultSha256": "0cbc8f6654919edd1f48d1a02f7987ffa8aead7f2e37f7afb8c330d162cb08af", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-006.json", + "expectedResult": "expected/C0.4-TOOL-006.json", + "requestSha256": "56bf79385e0038c233b59f81280523a84677ded599f78794069cdfccce860942", + "expectedResultSha256": "1b737d5cb6785a61963a2a0a1d78012ded874b2149d42a7f741f207e5009e492", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-007", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_review_list", - "status": "NOT_RUN", - "requestSha256": "e967106d2f59a7442cfb8f13dec8a69c6adf81f6fe5b02ea055fc9d8643f9cd9", - "expectedResultSha256": "0f687348323c9fb79b3e010ba1059f0b01fb237d2150269656301a59c6a7ea74", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-007.json", + "expectedResult": "expected/C0.4-TOOL-007.json", + "requestSha256": "813dedce8f75385b4250a50127632b6bd821a938673477db6f499c841f1fd423", + "expectedResultSha256": "61a12da5bed090a852ce791bb2de7fce99eddb87749b5361655301ca70336555", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-008", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_review_apply", - "status": "NOT_RUN", - "requestSha256": "c8cd1728200c8d98bac27f8935e4aae358c9d83c681d4de4936c354dc9172058", - "expectedResultSha256": "eed72a64303299660a5e72a3d6c17b3a77a62d2e726d68b49ccfae0f8724e32e", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-008.json", + "expectedResult": "expected/C0.4-TOOL-008.json", + "requestSha256": "4dc0f963b6dee3b3f848db7959fffc74289b623c1fefc04fe69a35fbe7d78694", + "expectedResultSha256": "1892c3d082a732c96e9b26779721d8a5617f4dfa3a8befd906eaf228dcf72710", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-009", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_stage_evidence_export", - "status": "NOT_RUN", - "requestSha256": "a5894fd288a2706a1d7a9656be071b5635fd0024b75b8c49008544f7816bcab8", - "expectedResultSha256": "8846512ab6ba25bff78a4520a517f1493f1ab7c61a33495d3d12546f95a1e06d", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": "stage_evidence", "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-009.json", + "expectedResult": "expected/C0.4-TOOL-009.json", + "requestSha256": "6c73786013c6bd991991cb937c2a1de70012b0a04da8781e244f8f7812b089e9", + "expectedResultSha256": "9f7264a48c4d0c8cdcb7d7f9dfc663cf722ef843fc2c47bb1465b9c6a91cb23d", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": "stage_evidence", + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-010", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_pipeline_submit", - "status": "NOT_RUN", - "requestSha256": "a3a2895c60cffcd16c0f42c7eed851c394effdf50168c122ce38fbf1c22b2cf3", - "expectedResultSha256": "777fd6dfe7e008c424961843f6bdf80503ac2a143d19b896d8df1e9f0616fe68", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": "pipeline_evidence", "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-010.json", + "expectedResult": "expected/C0.4-TOOL-010.json", + "requestSha256": "d774d44581c5a05f9cea30731f1c99502224c81e347187eadda44b4cf20c9db9", + "expectedResultSha256": "f62ce397b65dfee3bfa94b8bf70c4d6efbe1c3cf34c58a57a95167da9114d72e", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": "pipeline_evidence", + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-011", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_pipeline_claim", - "status": "NOT_RUN", - "requestSha256": "a2dd541057a6c88f1e774bd5c01d54b8381e5a986dddc3d16f389dd4687bd3db", - "expectedResultSha256": "d6d32c70c728ef562bf02a6d284c42db168c0bf07c7cf7884f75e2287b78b2df", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": "pipeline_evidence", "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-011.json", + "expectedResult": "expected/C0.4-TOOL-011.json", + "requestSha256": "0152066225f0df12b5c5de6031e9c8cd29a80c2a96197cd13f669687fac2043b", + "expectedResultSha256": "7a510e7450c8b9c289157c241773b53552c5b687aa2572b2846d7f103f701601", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": "pipeline_evidence", + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-012", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_pipeline_graph_receipt", - "status": "NOT_RUN", - "requestSha256": "f2285111a0f4e30791be7f705ae6c8d74d9903a8d4e626acf374dad1e7953f1f", - "expectedResultSha256": "8e53d791594a0a43e8b88524555c24b55a69c1884b67953462ac607b983114d7", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": "pipeline_evidence", "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-012.json", + "expectedResult": "expected/C0.4-TOOL-012.json", + "requestSha256": "bb6cc3ef41dc628636c2f51fc6595ef3519bd319098751205b939950c172ae24", + "expectedResultSha256": "51e88934a9886e9b87d262355486a41abee5b2b1897b9531613fbc3452886e69", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": "pipeline_evidence", + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-013", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_pipeline_stage_failure", - "status": "NOT_RUN", - "requestSha256": "1569e18abd7de46d74fd975f5c34b5ef190aba9c5a8249f65f7d0305932dbd9f", - "expectedResultSha256": "3e8a6f56082e0dd5c82d7e79fa5f3cc44df4f2894e355ce1f52ba2f06ad58739", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": "pipeline_evidence", "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-013.json", + "expectedResult": "expected/C0.4-TOOL-013.json", + "requestSha256": "c688cf82fbfdc84b808fcce63fbadc20cf067da188a24d48a47a17d976c64ba2", + "expectedResultSha256": "ab19aa45deab96f1a066f0d36cd5e3032fc27a7f7290c03095bc1a719884e070", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": "pipeline_evidence", + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-014", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_pipeline_write_receipt", - "status": "NOT_RUN", - "requestSha256": "cb19f1fdff1b82c762148fbb5e564a3dcc02c9f01e5b42d8a0a6e6e7f0f068bf", - "expectedResultSha256": "a6e027ba2bd513b46e3466ddeb667dc96e7e11591e567bfb887d0c9c99efeae3", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": "pipeline_evidence", "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-014.json", + "expectedResult": "expected/C0.4-TOOL-014.json", + "requestSha256": "4af1e12dad17b751d35095af41771f835e9be996aa621deffd1b43157daf505d", + "expectedResultSha256": "a9fe3b88711a6d532d7ce239a67205fdc15d671c02a0fbb09ba39930ac02df20", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": "pipeline_evidence", + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-015", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_pipeline_gate", - "status": "NOT_RUN", - "requestSha256": "20f26e37ee94c2caf2f6589848f27b8439395fd62cb39b7c4c0035b5a74954c3", - "expectedResultSha256": "5869871b1b55267cf1aef247b26548e932ac412cdb79a4ce8dad5de5e4d8a85d", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": "pipeline_evidence", "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-015.json", + "expectedResult": "expected/C0.4-TOOL-015.json", + "requestSha256": "610619974cc0f8382456d2648b045d225b12ee4a46e1f42f827df68ab76f2b74", + "expectedResultSha256": "10fe9b11f2610497a5b31b8ba0c1280550cea6c26e95e05f0d7d3776d42c468d", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": "pipeline_evidence", + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-016", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_pipeline_publication_receipt", - "status": "NOT_RUN", - "requestSha256": "5b8f4df502e507e3e57a0a4da2718a96ed4593048e667b893f6b0f0081c2c727", - "expectedResultSha256": "52ca60b9113749583e2534712113f3e439809861925dc1af6a10f9c291e8ec0c", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": "pipeline_evidence", "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-016.json", + "expectedResult": "expected/C0.4-TOOL-016.json", + "requestSha256": "3cf721556f22da13fdaef75c5d40e23fc350a8deb5a915b55c634371a4cdf74a", + "expectedResultSha256": "bdcad8bfea3e88531f5a10ea9747b5875c0847a5f6119059a59f86633dcdcf92", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": "pipeline_evidence", + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-TOOL-017", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tool", "tool": "gks_pipeline_evidence", - "status": "NOT_RUN", - "requestSha256": "39ac80947a628bacc1119a2c892304a0989cf7eeae940a516e46984daaecd6b6", - "expectedResultSha256": "b1afeb4fa03d7e140eb03bbd7ff517e0bfb8997c385b00d0b6f2eccb693c1ca8", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "jsonrpc-result-or-error", "opaqueRefs": [], "receiptHashes": [], "ledger": "pipeline_evidence", "cursorOutcome": "not-run", "errorCode": null, "assertions": ["registered tool and response envelope are preserved"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"], "reason": "Existing local contract tests are executable evidence; this C0.4 row has not been run by a corpus runner." } + "runnable": true, + "fixture": "cases/C0.4-TOOL-017.json", + "expectedResult": "expected/C0.4-TOOL-017.json", + "requestSha256": "a20a8f507cf1436843fb4aaea632b1806cef51834c13f626c29766538f9a1987", + "expectedResultSha256": "2cbbbe860607d0be4ab3b3999520c2a8e401bc665d90cc91c96b0ad24ab17f2e", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "jsonrpc-result-or-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": "pipeline_evidence", + "cursorOutcome": "replayed", + "errorCode": null, + "assertions": [ + "registered tool and response envelope are preserved" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ], + "reason": "Replayed by the C0.4 corpus runner against a real gks-server process; the contract tests cover the same tool in-process." + } }, { "id": "C0.4-API010-REPLAY", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "api-010-replay", - "status": "PASS", - "requestSha256": "24427691068f060a5eb5c8d6dc6dbfccaa9177a08264983adad291504004e1aa", - "expectedResultSha256": "dcbef9bc0cd526b5db70872fa933a887e5adf97350e0a55833b54a521c0ee5f6", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "api-010-compatible", "opaqueRefs": ["", ""], "receiptHashes": [], "ledger": "stage_evidence", "cursorOutcome": "idempotent-replay", "errorCode": null, "assertions": ["inner govibe-knowledge-candidate/v1 payload is unchanged", "replay returns the original opaque refs", "replay writes no duplicate evidence"] }, - "evidence": { "executable": true, "testPaths": ["tests/integration/stdio-restart.test.mjs", "tests/integration/msp-provider-compatibility.test.mjs", "tests/integration/msp-service-chain.test.mjs"], "reason": "Compatibility restart and actual MSP provider/service-chain tests passed; exact static golden hash replay is recorded separately in result-manifest.json." } + "runnable": true, + "fixture": "cases/C0.4-API010-REPLAY.json", + "expectedResult": "expected/C0.4-API010-REPLAY.json", + "requestSha256": "677b146ce490343535a18a0f6f7b392304a8a921a46c96729deae68afc325b9e", + "expectedResultSha256": "d8ee23e1d9285d2b85b06e5fd5f99519c524882c852bf791d289e82b6cb80072", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "api-010-compatible", + "opaqueRefs": [ + "", + "" + ], + "receiptHashes": [], + "ledger": "stage_evidence", + "cursorOutcome": "idempotent-replay", + "errorCode": "gks_conflict", + "assertions": [ + "inner govibe-knowledge-candidate/v1 payload is unchanged", + "replay after a restart returns the original opaque refs", + "replay writes no duplicate evidence", + "a changed payload under the same key is a conflict" + ] + }, + "evidence": { + "testPaths": [ + "tests/integration/stdio-restart.test.mjs", + "tests/integration/msp-provider-compatibility.test.mjs", + "tests/integration/msp-service-chain.test.mjs" + ], + "reason": "Replayed by the corpus runner across a server restart; the MSP provider and service-chain suites cover the same payload through MSP." + } }, { "id": "C0.4-TENANT-WALL", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "tenant-wall", - "status": "PASS", - "requestSha256": "6440177f879ce96ae3f9c841966b44ef7520521504dec87150fa52d3ccf3843e", - "expectedResultSha256": "a6f3984ee6009161ae1e67b8725c5f4ed89b3a9973a2c365b18ec5558cfedfbb", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "scoped-result-or-denial", "opaqueRefs": [""], "receiptHashes": [], "ledger": "canonical-knowledge", "cursorOutcome": "no-cross-tenant-cursor", "errorCode": "gks_scope_denied", "assertions": ["empty tenant matches only empty tenant", "tenanted and tenantless rows never cross", "portfolio sharing does not bypass the tenant wall", "forged scope is denied"] }, - "evidence": { "executable": true, "testPaths": ["tests/security/c0-tenant-wall.security.mjs", "tests/security/cross-tenant-deny.security.mjs", "tests/contract/stage9-persistence.test.mjs"], "reason": "Tenant-wall security and persistence tests passed; exact static golden hash replay is recorded separately in result-manifest.json." } + "runnable": true, + "fixture": "cases/C0.4-TENANT-WALL.json", + "expectedResult": "expected/C0.4-TENANT-WALL.json", + "requestSha256": "9629af2d895c84cc8e2a0de00ecf5ae834f6f93a366c02a7e92b785ac2b240fa", + "expectedResultSha256": "223a2e3028eeedfc80b4853d8c75825361c62d8723d328a66508e454912568a3", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "scoped-result-or-denial", + "opaqueRefs": [ + "" + ], + "receiptHashes": [], + "ledger": "canonical-knowledge", + "cursorOutcome": "no-cross-tenant-cursor", + "errorCode": "gks_scope_denied", + "assertions": [ + "empty tenant matches only empty tenant", + "tenanted and tenantless rows never cross", + "portfolio sharing does not bypass the tenant wall" + ] + }, + "evidence": { + "testPaths": [ + "tests/security/c0-tenant-wall.security.mjs", + "tests/security/cross-tenant-deny.security.mjs", + "tests/contract/stage9-persistence.test.mjs" + ], + "reason": "Replayed by the corpus runner; the security suites cover the same wall in-process. Forged scope digests are the auth-denial case." + } }, { "id": "C0.4-AUTH-DENIAL", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "auth-denial", - "status": "PASS", - "requestSha256": "ad0b37633a261978d91c91c220d73e876645f5c5e0cbbe0f0f5abb36a3c2fc42", - "expectedResultSha256": "5928faae65db461824b6a208b4b4177f6f7eaf12a31f7eacfd9e4bff05afe2c0", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "typed-denial", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "no-persistence", "errorCode": "gks_scope_denied", "assertions": ["missing, forged, stale, and mismatched MSP auth are denied", "auth material is not persisted or logged"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/c0-msp-auth.test.mjs", "tests/integration/msp-provider-compatibility.test.mjs", "tests/integration/msp-service-chain.test.mjs"], "reason": "Secure-mode auth contract and actual MSP provider/service-chain tests passed; exact static golden hash replay is recorded separately in result-manifest.json." } + "runnable": true, + "fixture": "cases/C0.4-AUTH-DENIAL.json", + "expectedResult": "expected/C0.4-AUTH-DENIAL.json", + "requestSha256": "bfda1685a4b5727c5849bdf9654ee5fcfda7e135f114dc4fba9b418b7936b9a4", + "expectedResultSha256": "c334e2fefbef7ad098e4db92d9e323472895bb70f4ab5b34461025e6f80f70a2", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "typed-denial", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "no-persistence", + "errorCode": "gks_scope_denied", + "assertions": [ + "missing, forged, stale, wrong-role and scope-mismatched MSP auth are denied", + "denials write nothing", + "auth material is not persisted or logged" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/c0-msp-auth.test.mjs", + "tests/integration/msp-provider-compatibility.test.mjs", + "tests/integration/msp-service-chain.test.mjs" + ], + "reason": "Replayed by the corpus runner in secure mode; the MSP suites cover the same envelope from the real MSP provider." + } }, { "id": "C0.4-TRANSPORT-DENIAL", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "transport-denial", - "status": "PASS", - "requestSha256": "f379969100065c005387acc13ef65e988ffa8b43f1158b23bb177ea1ff3728e5", - "expectedResultSha256": "d745bae3b77688b425f57bbe70e44ed3e19590ae1941f4946ecda8ca50c97faa", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "protocol-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "no-persistence", "errorCode": null, "assertions": ["oversized, malformed, deep, duplicate-key, and unsupported-batch frames are denied", "stdout contains protocol frames only", "diagnostics remain on stderr"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/c0-transport-bounds.test.mjs", "tests/integration/stdio-restart.test.mjs"], "reason": "Bounded transport and restart tests passed; exact static golden hash replay is recorded separately in result-manifest.json." } + "runnable": true, + "fixture": "cases/C0.4-TRANSPORT-DENIAL.json", + "expectedResult": "expected/C0.4-TRANSPORT-DENIAL.json", + "requestSha256": "0733c7dc4ab225f164160e80a1eff9556b99405a3dfccea127caee17c0cd8ff6", + "expectedResultSha256": "8370063b7c37edc09969823d29cad4bc61e09004f118884e6664f0aae4c142df", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "protocol-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "no-persistence", + "errorCode": null, + "assertions": [ + "oversized, malformed, invalid UTF-8, deep, duplicate-key, non-finite-number and batch frames are denied", + "stdout contains protocol frames only", + "the server keeps serving after every denial" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/c0-transport-bounds.test.mjs", + "tests/integration/stdio-restart.test.mjs" + ], + "reason": "Replayed by the corpus runner against the real stdio transport; the runner rejects any stdout line that is not a JSON-RPC frame." + } }, { "id": "C0.4-GENESISRAG17-RECEIPTS", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", + "category": "genesisrag17-receipts", + "runnable": true, + "fixture": "cases/C0.4-GENESISRAG17-RECEIPTS.json", + "expectedResult": "expected/C0.4-GENESISRAG17-RECEIPTS.json", + "requestSha256": "dd696274c80ab81f0a043e99e6b3351a2f0a0fced6235a223d2862421ffb4c1f", + "expectedResultSha256": "ad1f8586071c87fb06b1dde3748bb84b8583d55b4863d2eaf4dce8815a363e25", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "pipeline-result-or-denial", + "opaqueRefs": [ + "", + "" + ], + "receiptHashes": [ + "", + "", + "" + ], + "ledger": "pipeline_evidence", + "cursorOutcome": "ordered-stage-cursors", + "errorCode": null, + "assertions": [ + "receipts remain ordered and immutable", + "wrong hash, scope, or stage is denied", + "duplicate receipt is idempotent", + "failed terminal state blocks publication" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/pipeline-genesisrag17.test.mjs" + ], + "reason": "The GKS side of the receipt protocol, replayed by the corpus runner with frozen Tier-4 receipts. Physical Tier-4 readback is the separate C0.4-TIER4-READBACK case." + } + }, + { + "id": "C0.4-TIER4-READBACK", + "fixtureId": "gks-c0.4-golden", + "contractVersion": "c0-qualification/v2", "category": "genesisrag17-receipts", - "status": "NOT_RUN", - "requestSha256": "a9620c27a47695b22359347e461dfd3dba251d524744caeae98b27a7fdc895e4", - "expectedResultSha256": "93eb6cf9d0d1c6ff3351936aef0b4a4db402dca01f173011f995a79cf90d4998", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "pipeline-result-or-denial", "opaqueRefs": ["", ""], "receiptHashes": ["", "", ""], "ledger": "pipeline_evidence", "cursorOutcome": "ordered-stage-cursors", "errorCode": null, "assertions": ["receipts remain ordered and immutable", "wrong hash, scope, or stage is denied", "duplicate receipt is idempotent", "failed terminal state blocks publication"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/pipeline-genesisrag17.test.mjs"], "reason": "Local GenesisRAG17 receipt-ordering contract tests pass; external Tier-4 physical graph, worker, and publication readback remains NOT_RUN." } + "runnable": false, + "fixture": null, + "expectedResult": null, + "requestSha256": null, + "expectedResultSha256": null, + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "pipeline-result-or-denial", + "opaqueRefs": [], + "receiptHashes": [ + "", + "", + "" + ], + "ledger": "pipeline_evidence", + "cursorOutcome": "not-run", + "errorCode": null, + "assertions": [ + "GenesisBlockDB physical graph, index and publication readback match the GKS receipts" + ] + }, + "evidence": { + "testPaths": [], + "reason": "Physical Tier-4 readback needs a running GenesisBlockDB worker. GKS never calls outward (ADR-GKS-BOUNDARY), so this cannot run inside the GKS corpus and stays NOT_RUN." + } }, { "id": "C0.4-BACKEND-FAILURE", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "backend-failure", - "status": "PASS", - "requestSha256": "2e411244ea9c8eb6a995814b01992519e864eaae11311a4db63eec074fa3d760", - "expectedResultSha256": "7ccf964d5f3ecb6a3129876b6b8535463c131e22234020f98038db623c9d96bc", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "typed-error", "opaqueRefs": [], "receiptHashes": [], "ledger": null, "cursorOutcome": "no-partial-write", "errorCode": "gks_backend_unavailable", "assertions": ["backend failure is redacted to the typed error envelope", "no partial durable row is reported"] }, - "evidence": { "executable": true, "testPaths": ["tests/contract/server-dispatch.test.mjs", "tests/contract/persistence-error-redaction.test.mjs"], "reason": "Backend error redaction and no-partial-write contract tests passed; exact static golden hash replay is recorded separately in result-manifest.json." } + "runnable": true, + "fixture": "cases/C0.4-BACKEND-FAILURE.json", + "expectedResult": "expected/C0.4-BACKEND-FAILURE.json", + "requestSha256": "6cdd75f864baf86f5ec5036ef9fbfdf006d45d24d300389daa3b8d8336d73bc7", + "expectedResultSha256": "ba12100c104d405763137b8f5bf164042677248d2f4b26fc030a6633c49e5d7d", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "", + "workspaceId": "", + "projectId": "", + "sharing": "private" + }, + "expected": { + "responseEnvelope": "typed-error", + "opaqueRefs": [], + "receiptHashes": [], + "ledger": null, + "cursorOutcome": "no-partial-write", + "errorCode": "gks_backend_unavailable", + "assertions": [ + "a storage failure inside a write transaction is a typed gks_backend_unavailable error", + "the transaction rolls back: no entity or promotion row is left behind" + ] + }, + "evidence": { + "testPaths": [ + "tests/contract/server-dispatch.test.mjs", + "tests/contract/persistence-error-redaction.test.mjs" + ], + "reason": "Replayed by the corpus runner: the last table a promotion writes is dropped from a second connection, so the write fails after its earlier inserts." + } }, { "id": "C0.4-LOST-RESPONSE-REPLAY", "fixtureId": "gks-c0.4-golden", - "contractVersion": "c0-qualification/v1", + "contractVersion": "c0-qualification/v2", "category": "lost-response-replay", - "status": "NOT_RUN", - "requestSha256": "00c16167dee380d1b08b33f493aedb73f16d37ad9272f163b99e56ba02b86cf6", - "expectedResultSha256": "08ccf5a1f2e91bc83258a26ea8626f59a8d1559bcae2503540da846ace54d629", - "normalizedScope": { "portfolioId": "c0-portfolio", "tenantId": "c0-tenant", "businessId": "", "workspaceId": "", "agentId": "c0-agent", "visibility": "private" }, - "expected": { "responseEnvelope": "idempotent-replay", "opaqueRefs": [""], "receiptHashes": [], "ledger": "pipeline_evidence", "cursorOutcome": "same-durable-result", "errorCode": null, "assertions": ["a lost response can be replayed", "replay returns the durable result without duplicate writes"] }, - "evidence": { "executable": false, "testPaths": ["tests/integration/stdio-restart.test.mjs"], "reason": "Restart/idempotency is covered, but no process-loss-after-commit harness exists; this row remains an explicit NOT_RUN case." } + "runnable": true, + "fixture": "cases/C0.4-LOST-RESPONSE-REPLAY.json", + "expectedResult": "expected/C0.4-LOST-RESPONSE-REPLAY.json", + "requestSha256": "b8830e8b6d6c3a16ca605618afd720fba4e06abf44ee35e249a8cd0eeafab8b0", + "expectedResultSha256": "a96297a00e9a0c1beb0cd1c2d54eb37be09f533b3590fe00071fccb088545d16", + "normalizedScope": { + "portfolioId": "c0-portfolio", + "tenantId": "c0-tenant", + "businessId": "c0-business", + "workspaceId": "", + "agentId": "c0-agent", + "visibility": "private" + }, + "expected": { + "responseEnvelope": "idempotent-replay", + "opaqueRefs": [ + "", + "" + ], + "receiptHashes": [], + "ledger": "pipeline_evidence", + "cursorOutcome": "same-durable-result", + "errorCode": "gks_conflict", + "assertions": [ + "a response lost after the durable commit can be replayed", + "replay returns the committed result without a duplicate write", + "a changed payload under the same key is a conflict" + ] + }, + "evidence": { + "testPaths": [ + "tests/integration/lost-response-replay.test.mjs", + "tests/integration/stdio-restart.test.mjs" + ], + "reason": "Replayed by the corpus runner: the server is SIGKILLed once the write is durable and before the response is read." + } } ] } diff --git a/tests/fixtures/c0-qualification/result-manifest.json b/tests/fixtures/c0-qualification/result-manifest.json index 8cb94d7..44fbf19 100644 --- a/tests/fixtures/c0-qualification/result-manifest.json +++ b/tests/fixtures/c0-qualification/result-manifest.json @@ -1,9 +1,9 @@ { - "resultVersion": "c0-qualification-result/v1", - "registryVersion": "c0-qualification/v1", + "resultVersion": "c0-qualification-result/v2", + "registryVersion": "c0-qualification/v2", "fixtureId": "gks-c0.4-golden", - "recordedAt": "2026-09-22T00:00:00+07:00", - "baselineSha": "be97c93adb4308ea9b2d9f9a7a33425758a7176a", + "recordedAt": "2026-09-27", + "recordedFrom": "f50116abdc3fe606851df4d21697027e252341c7+working-tree", "runtime": { "node": "24.19.0", "platform": "win32", @@ -12,26 +12,22 @@ }, "runs": [ { - "id": "local-c0-contract", + "id": "c0-corpus", "status": "PASS", - "command": "npx vitest run tests/contract tests/integration", - "testFiles": 28, - "tests": 214, - "evidence": "Repository contract and integration suite passed with MSP_REPO_ROOT configured for the real-chain rows." - }, - { - "id": "local-c0-security", - "status": "PASS", - "command": "npm run test:security", - "tests": 11, - "evidence": "Tenant-wall and security suite passed with no unexplained failures." - }, + "command": "npm run check:corpus", + "cases": 24, + "evidence": "Every runnable case replayed against a real gks-server stdio process on a fresh store, twice, with identical normalized transcripts." + } + ], + "externalRuns": [ { "id": "msp-provider-chain", "status": "PASS", "command": "MSP_REPO_ROOT= npx vitest run tests/integration/msp-provider-compatibility.test.mjs tests/integration/msp-service-chain.test.mjs", "tests": 2, - "evidence": "Actual MSP provider and MSP service chain passed in secure transport mode." + "evidence": "Actual MSP provider and MSP service chain passed in secure transport mode.", + "recordedAt": "2026-09-22T00:00:00+07:00", + "baselineSha": "be97c93adb4308ea9b2d9f9a7a33425758a7176a" }, { "id": "msp-side-bridge", @@ -39,52 +35,270 @@ "command": "npx vitest run tests/integration/gks-provider-bridge.test.mjs tests/integration/gks-child-env-allowlist.test.mjs tests/contract/api-010-conformance.test.mjs", "testFiles": 3, "tests": 14, - "evidence": "MSP-side bridge, child environment allowlist, and API-010 conformance passed." + "evidence": "MSP-side bridge, child environment allowlist, and API-010 conformance passed.", + "recordedAt": "2026-09-22T00:00:00+07:00", + "baselineSha": "be97c93adb4308ea9b2d9f9a7a33425758a7176a" + } + ], + "cases": [ + { + "id": "C0.4-TOOL-001", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-001.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-001.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-002", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-002.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-002.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-003", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-003.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-003.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-004", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-004.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-004.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-005", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-005.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-005.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-006", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-006.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-006.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-007", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-007.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-007.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-008", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-008.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-008.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-009", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-009.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-009.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-010", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-010.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-010.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-011", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-011.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-011.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] }, { - "id": "lost-response-replay", + "id": "C0.4-TOOL-012", "status": "PASS", - "recordedAt": "2026-09-27", - "command": "npx vitest run tests/integration/lost-response-replay.test.mjs", - "tests": 3, - "evidence": "A real stdio server process is killed with SIGKILL after the write is durable in SQLite and before the caller reads a response; a fresh process replays the request and returns the committed legacy promotion, pipeline submit and Tier-4 graph receipt results as idempotent, with one committed row each, while a changed payload under the same key is gks_conflict." + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-012.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-012.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-013", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-013.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-013.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-014", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-014.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-014.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-015", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-015.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-015.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-016", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-016.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-016.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-TOOL-017", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TOOL-017.json", + "tests/fixtures/c0-qualification/expected/C0.4-TOOL-017.json", + "tests/contract/tool-registry.test.mjs", + "tests/contract/server-dispatch.test.mjs" + ] + }, + { + "id": "C0.4-API010-REPLAY", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-API010-REPLAY.json", + "tests/fixtures/c0-qualification/expected/C0.4-API010-REPLAY.json", + "tests/integration/stdio-restart.test.mjs", + "tests/integration/msp-provider-compatibility.test.mjs", + "tests/integration/msp-service-chain.test.mjs" + ] + }, + { + "id": "C0.4-TENANT-WALL", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TENANT-WALL.json", + "tests/fixtures/c0-qualification/expected/C0.4-TENANT-WALL.json", + "tests/security/c0-tenant-wall.security.mjs", + "tests/security/cross-tenant-deny.security.mjs", + "tests/contract/stage9-persistence.test.mjs" + ] + }, + { + "id": "C0.4-AUTH-DENIAL", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-AUTH-DENIAL.json", + "tests/fixtures/c0-qualification/expected/C0.4-AUTH-DENIAL.json", + "tests/contract/c0-msp-auth.test.mjs", + "tests/integration/msp-provider-compatibility.test.mjs", + "tests/integration/msp-service-chain.test.mjs" + ] + }, + { + "id": "C0.4-TRANSPORT-DENIAL", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-TRANSPORT-DENIAL.json", + "tests/fixtures/c0-qualification/expected/C0.4-TRANSPORT-DENIAL.json", + "tests/contract/c0-transport-bounds.test.mjs", + "tests/integration/stdio-restart.test.mjs" + ] + }, + { + "id": "C0.4-GENESISRAG17-RECEIPTS", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-GENESISRAG17-RECEIPTS.json", + "tests/fixtures/c0-qualification/expected/C0.4-GENESISRAG17-RECEIPTS.json", + "tests/contract/pipeline-genesisrag17.test.mjs" + ] + }, + { + "id": "C0.4-TIER4-READBACK", + "status": "NOT_RUN", + "evidence": [], + "reason": "Physical Tier-4 readback needs a running GenesisBlockDB worker. GKS never calls outward (ADR-GKS-BOUNDARY), so this cannot run inside the GKS corpus and stays NOT_RUN." + }, + { + "id": "C0.4-BACKEND-FAILURE", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-BACKEND-FAILURE.json", + "tests/fixtures/c0-qualification/expected/C0.4-BACKEND-FAILURE.json", + "tests/contract/server-dispatch.test.mjs", + "tests/contract/persistence-error-redaction.test.mjs" + ] + }, + { + "id": "C0.4-LOST-RESPONSE-REPLAY", + "status": "PASS", + "evidence": [ + "tests/fixtures/c0-qualification/cases/C0.4-LOST-RESPONSE-REPLAY.json", + "tests/fixtures/c0-qualification/expected/C0.4-LOST-RESPONSE-REPLAY.json", + "tests/integration/lost-response-replay.test.mjs", + "tests/integration/stdio-restart.test.mjs" + ] } ], - "cases": [ - { "id": "C0.4-TOOL-001", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"] }, - { "id": "C0.4-TOOL-002", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/integration/msp-provider-compatibility.test.mjs"] }, - { "id": "C0.4-TOOL-003", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"] }, - { "id": "C0.4-TOOL-004", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"] }, - { "id": "C0.4-TOOL-005", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"] }, - { "id": "C0.4-TOOL-006", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"] }, - { "id": "C0.4-TOOL-007", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"] }, - { "id": "C0.4-TOOL-008", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs"] }, - { "id": "C0.4-TOOL-009", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/integration/msp-service-chain.test.mjs"] }, - { "id": "C0.4-TOOL-010", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/contract/pipeline-genesisrag17.test.mjs"] }, - { "id": "C0.4-TOOL-011", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/contract/pipeline-genesisrag17.test.mjs"] }, - { "id": "C0.4-TOOL-012", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/contract/pipeline-genesisrag17.test.mjs"] }, - { "id": "C0.4-TOOL-013", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/contract/pipeline-genesisrag17.test.mjs"] }, - { "id": "C0.4-TOOL-014", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/contract/pipeline-genesisrag17.test.mjs"] }, - { "id": "C0.4-TOOL-015", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/contract/pipeline-genesisrag17.test.mjs"] }, - { "id": "C0.4-TOOL-016", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/contract/pipeline-genesisrag17.test.mjs"] }, - { "id": "C0.4-TOOL-017", "status": "PASS", "evidence": ["tests/contract/tool-registry.test.mjs", "tests/contract/server-dispatch.test.mjs", "tests/contract/pipeline-genesisrag17.test.mjs"] }, - { "id": "C0.4-API010-REPLAY", "status": "PASS", "evidence": ["tests/integration/stdio-restart.test.mjs", "tests/integration/msp-provider-compatibility.test.mjs", "tests/integration/msp-service-chain.test.mjs", "external MSP api-010-conformance.test.mjs"] }, - { "id": "C0.4-TENANT-WALL", "status": "PASS", "evidence": ["tests/security/c0-tenant-wall.security.mjs", "tests/security/cross-tenant-deny.security.mjs"] }, - { "id": "C0.4-AUTH-DENIAL", "status": "PASS", "evidence": ["tests/contract/c0-msp-auth.test.mjs", "tests/integration/msp-provider-compatibility.test.mjs", "tests/integration/msp-service-chain.test.mjs"] }, - { "id": "C0.4-TRANSPORT-DENIAL", "status": "PASS", "evidence": ["tests/contract/c0-transport-bounds.test.mjs", "tests/integration/stdio-restart.test.mjs"] }, - { "id": "C0.4-GENESISRAG17-RECEIPTS", "status": "NOT_RUN", "evidence": ["tests/contract/pipeline-genesisrag17.test.mjs"], "reason": "Local GenesisRAG17 contract tests are covered; actual external Tier-4 physical graph, worker, and publication readback was not run and is outside the C0 local/MSP boundary." }, - { "id": "C0.4-BACKEND-FAILURE", "status": "PASS", "evidence": ["tests/contract/server-dispatch.test.mjs", "tests/contract/persistence-error-redaction.test.mjs"] }, - { "id": "C0.4-LOST-RESPONSE-REPLAY", "status": "PASS", "evidence": ["tests/integration/lost-response-replay.test.mjs", "tests/integration/stdio-restart.test.mjs"] } - ], "summary": { - "PASS": 23, + "PASS": 24, "FAIL": 0, "NOT_RUN": 1, "BLOCKED": 0 }, "gate": { "status": "PASS_WITH_LIMITATIONS", - "meaning": "C0 local contracts, secure MSP auth/provider chain, tenant wall, and bounded transport are qualified; Tier-4 physical readback, Python reference validation, Node 22 local matrix, and deployment remain outside this closeout.", + "meaning": "Every runnable C0.4 case replays from its tracked request fixture to its golden transcript. Tier-4 physical readback is outside the GKS boundary and stays NOT_RUN; deployment is not authorized by this gate.", "productionReady": false, "deploymentAuthorized": false } diff --git a/tests/integration/c0-corpus.test.mjs b/tests/integration/c0-corpus.test.mjs new file mode 100644 index 0000000..b75da82 --- /dev/null +++ b/tests/integration/c0-corpus.test.mjs @@ -0,0 +1,23 @@ +// @req GKS-MIG-002, C0.4 — every runnable golden case replays from its tracked +// request fixture to its golden transcript against a real gks-server process. +// The same check runs as `npm run check:corpus` in the c0-gate CI slice. +import { describe, expect, it } from "vitest"; +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { CORPUS_DIR, firstDifference, readJson, runCase, sha256Canonical } from "../../scripts/c0-corpus/runner.mjs"; + +const root = path.resolve("."); +const registry = JSON.parse(readFileSync(path.join(root, CORPUS_DIR, "registry.json"), "utf8")); +// Each case spawns at least one server process; allow for a slow runner. +const CASE_TIMEOUT_MS = 60_000; + +describe("C0.4 golden corpus replay", () => { + for (const qualificationCase of registry.cases.filter((item) => item.runnable)) { + it(`${qualificationCase.id} replays to its golden transcript`, async () => { + const run = await runCase(root, readJson(root, `${CORPUS_DIR}/${qualificationCase.fixture}`)); + expect(run.problems).toEqual([]); + const expected = readJson(root, `${CORPUS_DIR}/${qualificationCase.expectedResult}`); + expect(sha256Canonical(run.transcript), firstDifference(expected, run.transcript) ?? "").toBe(qualificationCase.expectedResultSha256); + }, CASE_TIMEOUT_MS); + } +});