Repository navigation
fix: require submitted stage identities in catalog order - #24
Merged
Merged
Conversation
GKS-PIP-001 was an open owner decision in the P1 report. A submitted GenesisRAG17 batch was accepted with its nine stage identities in any order. gks_pipeline_submit now requires them in catalog order, 9 through 17. Anything else is gks_invalid_request, and the message names the first misplaced position: "stages[1] must be stage 10: stages are listed in catalog order, 9 through 17." Graph and worker receipts are deliberately left order-insensitive: - Persistence already matches a receipt to its stored decision after sorting. - A decision stored before this rule keeps its submitted order, and the worker echoes it back, so rejecting that order would strand the decision. - Receipt hashes cover the order as sent, so normalizing it would turn recorded replays into conflicts. The real producer, zuri-ai's buildGenesisRag17StageIdentities, already emits stages 9 to 17 in order. The C0.4 golden corpus replayed unchanged before its fixtures were rebuilt. TOOL-010 gains an out-of-order submission step, and it is the only transcript that changes. Docs: GKS-PORT-CONTRACT 0.10.2b, ADR-GKS-GENESISRAG17 0.5.3b, and the P1 report row is closed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR closes owner decision GKS-PIP-001 from the P1 report. Until now, a GenesisRAG17 batch was accepted with its nine stage identities in any order.
Change (
packages/gks-contracts/src/pipeline.mjs,validateStageIdentities)gks_pipeline_submit(batch.stages)gks_invalid_request, and the message names the first position that is wrong, for examplestages[1] must be stage 10: stages are listed in catalog order, 9 through 17.gks_pipeline_graph_receiptandgks_pipeline_write_receipt(receipt.stages)catalogOrder: false).The existing checks run first and their messages are unchanged: exactly nine identities, no duplicates, and each stage under its own
DPS-KI-*id.Why receipts stay order-insensitive
sameStageIdentity).Compatibility
The real producer is zuri-ai's
buildGenesisRag17StageIdentities(apps/server/src/modules/knowledge/genesisrag17-contract.js). It already builds the identities by looping from stage 9 to 17, so it always emits them in catalog order. MSP forwards the batch unchanged. This repository'smakeBatchfixture also builds them in catalog order.Golden corpus
check:corpusreplayed all 24 cases unchanged.C0.4-TOOL-010(the submit case) gains anoutOfOrderstep: a batch with stages 10 and 11 swapped. It expectsgks_invalid_requestand pins the exact message.Docs
GKS-PORT-CONTRACT0.10.2b: the "Stage identity and receipt ordering" section now states the rule and why receipts are exempt.ADR-GKS-GENESISRAG170.5.3b: new revision row.Test plan
tests/contract/c0-acceptance.test.mjsadds:npm test: vitest 298 passed, 2 skipped (the MSP suites needMSP_REPO_ROOT); security 12/12.npm run check:c0(PASS 24 / NOT_RUN 1),check:baselineandcheck:corpuspass.🤖 Generated with Claude Code