Repository navigation
Add durable implementation session provenance - #2065
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🟡 Impact Analysis — PR #2065Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affecteddocs (1 file)
root (9 files)
tests (4 files)
This report is generated automatically for every PR. See #733 for details. |
🛫 PR Readiness Check
PR Scope: 🔧 Infrastructure
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 5 commits — consider squashing before review |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | No source files changed — changeset not required |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ✅ | Copilot threads resolved | 1 active Copilot thread(s) resolved (2 outdated skipped) |
| ✅ | CI passing | All checks passing |
Files Changed (14 files, +2066 −76)
| File | +/− |
|---|---|
docs/src/content/docs/guide/gh-aw.md |
+74 −1 |
test-fixtures/implementation-provenance/multi-goal-replacement-v1.json |
+44 −0 |
test-fixtures/implementation-provenance/valid-v1.json |
+34 −0 |
test/gh-aw-implement-workflow.test.ts |
+7 −7 |
test/gh-aw-implementation-provenance.test.ts |
+637 −0 |
test/gh-aw-quality.test.ts |
+12 −6 |
test/gh-aw-retro-workflow.test.ts |
+17 −7 |
workflows/shared/implementation-provenance-v1.schema.json |
+120 −0 |
workflows/shared/squad-implementation-provenance.mjs |
+750 −0 |
workflows/shared/squad-retro-provenance.mjs |
+35 −3 |
workflows/squad-deps-worker.md |
+151 −0 |
workflows/squad-implement-worker.md |
+139 −10 |
workflows/squad-retro.md |
+17 −14 |
workflows/squad.md |
+29 −28 |
Total: +2066 −76
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical mutable-ref trust issues and schema-validation gaps remain, along with an inappropriate package changeset.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (3)
What changed in this PR
Adds durable implementation-session provenance across Squad workflows, validation, schemas, tests, fixtures, and documentation.
Changes:
- Propagates session IDs through implementation, dependency, and retrospective workflows.
- Adds provenance schema, runtime guards, fixtures, and contract tests.
- Documents provenance lifecycle and migration semantics.
| File | Summary |
|---|---|
workflows/squad.md |
Adds session IDs to implementation dispatches. |
workflows/squad-retro.md |
Propagates retrospective session IDs. |
workflows/squad-implement-worker.md |
Validates and emits implementation provenance. |
workflows/squad-deps-worker.md |
Adds dependency-worker provenance enforcement. |
workflows/shared/squad-retro-provenance.mjs |
Updates retrospective input validation. |
workflows/shared/squad-implementation-provenance.mjs |
Implements provenance parsing and validation. |
workflows/shared/implementation-provenance-v1.schema.json |
Defines the v1 provenance schema. |
test/gh-aw-retro-workflow.test.ts |
Updates retrospective workflow coverage. |
test/gh-aw-implementation-provenance.test.ts |
Tests provenance behavior and wiring. |
test-fixtures/implementation-provenance/valid-v1.json |
Adds a valid provenance fixture. |
test-fixtures/implementation-provenance/multi-goal-replacement-v1.json |
Adds multi-goal and replacement coverage. |
docs/src/content/docs/guide/gh-aw.md |
Documents provenance semantics. |
.changeset/implementation-session-provenance.md |
Records package release metadata. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bradygaster
left a comment
There was a problem hiding this comment.
Blocking authoritative-producer review for Squadcaster issue #44. I cannot use GitHub’s REQUEST_CHANGES state on my own PR, so treat this COMMENT review as blocking. The provenance contract is not yet safe to consume: unresolved self PR identity can reach durable output, dispatcher/runtime identity is not bound strongly enough, trusted validation code is loaded from a mutable default branch, replacement evidence is under-validated, negative/worker-path coverage is incomplete, and release metadata is incorrect. CI also fails the clean-install runtime closure and authored-source growth guards. Please address every inline finding and restore all required checks before rereview.
bradygaster
left a comment
There was a problem hiding this comment.
Final exact-head rereview remains blocking. GitHub does not allow REQUEST_CHANGES on my own PR, so treat this COMMENT review as a blocking verdict. The temporary-PR provenance guard checks a field that the compiled add_comment output does not use.
| function provenanceCommentsForPull(items, pull) { | ||
| const id = normalizeTemporaryId(pull.temporary_id); | ||
| return items.filter(item => item.type === 'add_comment' && | ||
| normalizeTemporaryId(item.temporary_id) === id && |
There was a problem hiding this comment.
Blocking: Compiled add_comment safe outputs target the temporary PR with item_number, but this boundary filters on item.temporary_id. A malformed provenance-like comment using the production shape (item_number: "#aw_impl42") is therefore not selected for validation, returns ok: true, and can cross both worker guards into a bot-authored durable comment. Match the compiled field (item_number) and update the adversarial tests to use the real output shape; prove malformed/partial/unknown/duplicate/mixed candidates fail closed in both compiled worker handlers.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>


Summary
Adds the authoritative Squad producer contract required by bradygaster/squadcaster#44.
implementation-provenance/v1JSON Schema and runtime validatorgithub.workflow_sha, eliminating mutable-default-branch validator TOCTOU<!-- squad:implement issue=... run=... -->marker and closing references unchangedValidation
npm run buildnpm test -- --run test/gh-aw-implementation-provenance.test.ts test/gh-aw-implement-workflow.test.ts test/gh-aw-deps-routing.test.ts test/gh-aw-retro-workflow.test.ts test/gh-aw-quality.test.ts— 493 passedCHANGELOG.mdcatalog assertion was reproduced unchanged on base commit2099faf5Security review
The pre-agent and safe-output validators are loaded from an immutable checkout pinned to
github.workflow_sha, with persisted credentials disabled. Worker identity is corroborated against the authoritative dispatcher Actions run and durable bot dispatch receipt. The post-create handler resolves the safe-output temporary-ID map, fetches the created PR, validates the actual repository/number/head ref, verifies replacement PR provenance through the GitHub API, and only then writes the bot-authored durable payload.No new permissions, secrets, dependencies, or unpinned actions are introduced. The new guard uses only the existing pinned
actions/checkoutandactions/github-scriptactions.Compatibility
Older PRs are not rewritten. Missing v1 evidence leaves the implementation session unknown; consumers may continue using legacy explicit markers and closing references without manufacturing a session ID. Malformed, partial, duplicated, fabricated, or stale evidence is never silently upgraded to authoritative v1 provenance.
Scope
Infrastructure/workflow contract only; no CLI or SDK public API change. No package changeset is included.