Skip to content

test(distribution): schema-engine fixture-agreement contract - #359

Merged
kyle-sexton merged 1 commit into
mainfrom
cursor/sync-manifest-schema-fixture-agreement-f19e
Aug 12, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
cursor/sync-manifest-schema-fixture-agreement-f19e

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Summary

Implements the Frontier consensus on #331: add a fixture-agreement contract test (schema ∩ engine on fixtures). Does not add a second live CI gate against distribution/sync-manifest.yml.

  • Formalize agreement helpers so structural fixtures must be rejected by both validate-sync-manifest.mjs and sync-manifest.sh.
  • Document the schema as an overlapping structural subset; the Bash engine remains authoritative for the live manifest.

Test plan

  • Distribution fixture tests updated for agreement contract
  • CI green on merge

Related

Closes #331

Frontier consensus ACCEPT (Fable+Sol): fixture-agreement only; no second live schema gate.

Open in Web Open in Cursor 

@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c9660b715

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread distribution/sync-manifest.test.sh Resolved
@claude

claude Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 6m 28s —— View job


Claude's review

  • Gather context (CLAUDE.md, REVIEW.md, PR diff)
  • Review distribution/sync-manifest.schema.json
  • Review distribution/validate-sync-manifest.mjs
  • Review distribution/sync-manifest.test.sh
  • Review distribution/README.md
  • Post findings

Note on verification: I could not execute the test suite (sync-manifest.test.sh) or yq directly in this sandbox — invoking yq requires an approval that isn't available in this non-interactive lane, and distribution/node_modules isn't installed here. The analysis below is a static read of the diff, sync-manifest.sh's duplicate-key/merge-key detection logic, and the JSON Schema, not an executed run. The PR's own "CI green on merge" test-plan item is author-claimed and unverified by me.

Summary

The PR's core design — categorizing each invalid_case as structural (schema and engine must both reject) vs. engine-only (only the engine can express the rule) — holds up on inspection. I checked each engine-only case against what the JSON Schema in sync-manifest.schema.json can actually express (property-level types/patterns, uniqueItems, additionalProperties: false) versus what requires cross-record or Git-state logic the schema cannot see (destination-ownership collisions, path-traversal safety, dependency-graph closure, duplicate-key detection on yq's raw node tree, cross-mapping directory conflicts). Every case marked engine-only genuinely falls outside schema-expressible validation, and every case left as the structural default is schema-catchable (via type mismatches, pattern, const, minProperties, uniqueItems, or additionalProperties), even where the schema's rejection reason differs from the engine's diagnostic text — which the contract doesn't require to match, only that both reject.

One finding worth a look, left as an inline comment on distribution/sync-manifest.test.sh:

  • Suggestion — the refactor deletes the only two assertions that checked validate-sync-manifest.mjs's actual error-message content (the control-character and non-boolean-automerge cases), replacing them with exit-code-only structural checks. The new schema_rc_for_yaml helper's stderr_file parameter exists for exactly this purpose but is never passed by any caller, so it's currently dead. This doesn't affect the fixture-agreement contract itself, but it does mean the message-formatting branches in validate-sync-manifest.mjs (additionalProperties/propertyNames/const handling) are no longer exercised by any test.

distribution/README.md and distribution/sync-manifest.schema.json changes are documentation/metadata only (a description field, and prose reconciling the schema-vs-engine authority split) and are consistent with each other and with the code.
· Branch

Comment thread distribution/sync-manifest.test.sh Resolved
@github-actions

Copy link
Copy Markdown

Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count.

@cursor
cursor Bot force-pushed the cursor/sync-manifest-schema-fixture-agreement-f19e branch 2 times, most recently from 51ca408 to e13a014 Compare August 12, 2026 00:14
@kyle-sexton

Copy link
Copy Markdown
Member Author

Resolved both review threads in 7615704:

  • Fixture agreement coverage: added valid_case; routed shared-source + explicit-automerge valid fixtures through schema; converted empty-file-source and bare-newline rejects to invalid_case.
  • Schema diagnostics: optional schema_needle param wires stderr_file for control-char (must match pattern) and non-boolean-automerge (automerge) cases.

distribution/sync-manifest.test.sh passes locally. Commit signature verified (verified: true). All review threads resolved.

@kyle-sexton kyle-sexton changed the title test(distribution): add schema-engine fixture-agreement contract test(distribution): schema-engine fixture-agreement contract Aug 12, 2026
…nostics

- Add valid_case helper; route shared-source and automerge valid fixtures through schema
- Convert empty-source and bare-newline structural rejects to invalid_case
- Assert schema stderr needles for control-char and non-boolean automerge cases

Co-authored-by: Kyle Sexton <[email protected]>
@cursor
cursor Bot force-pushed the cursor/sync-manifest-schema-fixture-agreement-f19e branch from 7615704 to 70f03b5 Compare August 12, 2026 00:39
@kyle-sexton
kyle-sexton merged commit a75112a into main Aug 12, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the cursor/sync-manifest-schema-fixture-agreement-f19e branch August 12, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decide whether validate-sync-manifest.mjs should gate the live manifest in CI

2 participants