Skip to content

Commit 3a7fb53

Browse files
bradygasterCopilot
andcommitted
fix: close specification suite contracts
Part of #2069 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent f5ced9d commit 3a7fb53

11 files changed

Lines changed: 614 additions & 141 deletions

‎docs/specification/README.md‎

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
**Working-draft provenance:** [PR #2078](https://github.com/bradygaster/squad/pull/2078)
1010
contains this suite revision. Its rejected review baseline is
1111
[`c03ba950fde071c8ec58a64504fdb7b5cf1206ef`](https://github.com/bradygaster/squad/commit/c03ba950fde071c8ec58a64504fdb7b5cf1206ef).
12-
Revision cycle 2 is authored by `agent-orchestration-dev`; the original
13-
Architect author and rejecting reviewers are excluded from implementation by
14-
the governance lockout.
12+
Revision cycle 2 was authored by `agent-orchestration-dev`; final revision
13+
cycle 3 is authored by `unit-contract-tester`. The original Architect author
14+
and rejecting reviewers are excluded from implementation by the governance
15+
lockout.
1516

1617
The source index keeps `publication.revision` and `publication.digest` null
1718
while it is a working draft. After review, the exact head SHA is recorded in
@@ -26,17 +27,18 @@ index without a self-referential hash that would invalidate the commit.
2627

2728
**Foundation profile:** [Squad Charter Profile v0.1](charter-v0.1.md)
2829

29-
This directory maps all major stable or observable Squad surfaces. It
30-
distinguishes the one executable normative profile from experimental schemas,
31-
non-claimable requirements drafts, and informative coverage.
30+
This directory maps all major stable or observable Squad surfaces. Publication
31+
status is independent from maturity: this suite is an unpublished working
32+
draft even where a profile has executable conformance evidence.
3233

3334
## Maturity taxonomy
3435

35-
The suite uses exactly four maturity values:
36+
The suite uses exactly five maturity values:
3637

3738
| Maturity | Meaning | Claimable |
3839
|---|---|---|
39-
| `published-normative` | Executable manifest and schema with reviewed cases | Yes, only identifiers declared by that manifest |
40+
| `executable-normative-draft` | Normative working draft with an executable manifest and schema | Yes, only identifiers declared by that manifest; not published |
41+
| `experimental-normative-draft` | Normative working draft whose rules are exercised only through dependent profiles or partial evidence | No standalone claims |
4042
| `experimental-schema` | Machine-valid schema or fixture, but no complete conformance manifest | No |
4143
| `requirements-draft` | Conceptual and behavioral requirements awaiting portable fixtures | No |
4244
| `informative-draft` | Coverage, observations, or volatile requirements | No |
@@ -60,9 +62,9 @@ deviations are summarized here and expanded in the
6062

6163
| ID | Maturity / class | Dependencies | Claimable capabilities | Schema/manifest | Implementation status | Known deviations | Reader entry path |
6264
|---|---|---|---|---|---|---|---|
63-
| `squad-core/v0.1` | `requirements-draft` / requirements | None | None | None | Terminology is used by Charter | Canonical JSON and publication rules incomplete | [Core](core-v0.1.md), then Charter |
65+
| `squad-core/v0.1` | `experimental-normative-draft` / normative profile | None | None | None | Normative rules are exercised by Charter; no standalone Core manifest | Canonical JSON and standalone Core cases incomplete | [Core](core-v0.1.md), then Charter |
6466
| `squad-interop/v0.1` | `experimental-schema` / normative schema | Core | None | Shared evidence schema; no manifest | Evidence validation is executable | No discovery or replay corpus | [Interoperability](interoperability-conventions-v0.1.md) |
65-
| `squad-charter/v0.1` | `published-normative` / normative profile | Core | `squad-charter/v0.1/parse`, `squad-charter/v0.1/validate`, `squad-charter/v0.1/edit`, `squad-charter/v0.1/legacy-consume`, `squad-charter/v0.1/runtime` | Manifest and schema | Parser, validator, editor, compiler, and cases implemented | None registered | [Charter](charter-v0.1.md) |
67+
| `squad-charter/v0.1` | `executable-normative-draft` / normative profile | Core | `squad-charter/v0.1/parse`, `squad-charter/v0.1/validate`, `squad-charter/v0.1/edit`, `squad-charter/v0.1/legacy-consume`, `squad-charter/v0.1/runtime` | Manifest and schema | Parser, validator, editor, compiler, and cases implemented | None registered | [Charter](charter-v0.1.md) |
6668
| `squad-team-routing/v0.1` | `requirements-draft` / requirements | Core, Interop, Charter | None | None | Roster and routing exist in multiple shapes | Fallback and ambiguity differ | [Roster, then routing](team-routing-v0.1.md) |
6769
| `squad-configuration-casting/v0.1` | `requirements-draft` / requirements | Core, Interop, Team/Routing | None | None | Configuration, registry, and history implemented | Legacy shapes and runtime-only keys | [Configuration, casting, provenance](configuration-casting-v0.1.md) |
6870
| `squad-governance-review/v0.1` | `experimental-schema` / normative schema | Core, Interop, Team/Routing | None | Evidence schema plus rejection fixture; no manifest | Rejection records are machine-valid | Baseline owner self-revision conflict | [Evidence contract, then transitions](governance-review-v0.1.md) |
@@ -140,17 +142,18 @@ and the GitHub binding
140142
identify their narrower assumptions. An informative precedent does not become
141143
a suite requirement merely by being cited.
142144

143-
The existing `test/docs-links.test.ts` command scans `docs/src/content/**` and
144-
the root README, not `docs/specification/**`; there is no existing supported
145-
link-check command for this directory. The suite test verifies every indexed
146-
specification, schema, manifest, and fixture path exists. External URL
147-
availability and section anchors remain review-time checks until the repository
148-
link checker expands its supported scope.
145+
`test/specification-suite.test.ts` deterministically checks every Markdown file
146+
in this directory for relative targets, local heading anchors, and absolute
147+
HTTPS external citations. It also verifies every indexed specification,
148+
schema, manifest, and fixture path. The check is intentionally offline:
149+
external URL availability and remote anchor existence remain review-time or
150+
publication-pipeline checks.
149151

150152
## Versioning policy
151153

152154
Profile identifiers use `vMAJOR.MINOR`; mutable state revisions, provider API
153155
versions, implementation versions, and the observed portable-bundle `1.0`
154-
version are distinct. Draft documents may change before promotion. Published
155-
normative revisions are immutable except for dated errata; behavior changes
156+
version are distinct. Draft documents may change before promotion. Only a
157+
`publication.status` of `published` denotes an immutable publication; published
158+
normative revisions are immutable except for dated errata, and behavior changes
156159
require a new profile version.

‎docs/specification/artifact-inventory.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ render them beneath `.squad/`.
1313
| Surface | Repository evidence | Disposition | Specification | Maturity or promotion rationale |
1414
|---|---|---|---|---|
1515
| Discovery, negotiation, authority identity, shared evidence, secrets | Core/profile metadata, registry IDs, events, audit records | Experimental shared schema; no claim | Interoperability Conventions v0.1 | Evidence schema exists; discovery and negotiation need a manifest |
16-
| Agent charter | `agents/{id}/charter.md`, compiler, validator, fixtures | Normative profile now | Charter v0.1 | Stable parser and round-trip evidence |
16+
| Core rules | profile identifiers, paths, diagnostics, trust boundary | Experimental normative working draft; no standalone claim | Core v0.1 | Charter depends on and exercises Core rules, but Core has no standalone manifest |
17+
| Agent charter | `agents/{id}/charter.md`, compiler, validator, fixtures | Executable normative working draft | Charter v0.1 | Stable parser and round-trip evidence; publication remains `working-draft` |
1718
| Team roster | `team.md`, roster templates, presets | Requirements draft; no claim | Team and Routing v0.1 | Promote independently with roster parsing, mutation, join, and diagnostic cases |
1819
| Routing ownership | `routing.md`, routing parser, coordinator tests | Requirements draft; no claim | Team and Routing v0.1 | Promote independently with priority, fallback, ambiguity, stale-write, and resolution cases |
1920
| Runtime configuration | `config.json`, config schema and loaders | Requirements draft; no claim | Configuration and Casting v0.1 | Promote independently with precedence and source-evidence cases |

‎docs/specification/github-work-lifecycle-binding-v0.1.md‎

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,35 @@ provider range is revalidated.
126126

127127
## 8. Versioned provider assumptions and references
128128

129-
This draft assumes GitHub REST API version `2022-11-28`, GraphQL schema behavior
130-
observed on 2026-09-25, and `gh` operations that map to those APIs. A conforming
131-
binding must publish its exact supported API versions and observation date.
132-
An unavailable version returns `unsupported-provider-version`; a changed field,
133-
enum, mutation, or ruleset behavior returns `provider-drift` and fails closed
134-
for mutation until revalidated.
129+
This draft assumes GitHub REST API version `2022-11-28`. GraphQL field names and
130+
`gh` transport behavior are informative provider observations only; they are
131+
not normative evidence for this non-claimable binding. A future executable
132+
binding is expected to publish exact supported API versions and observation
133+
dates. An unavailable version is expected to return
134+
`unsupported-provider-version`; a changed field, enum, mutation, or ruleset
135+
behavior is expected to return `provider-drift` and fail closed for mutation
136+
until revalidated.
137+
138+
The GraphQL field observation was reproduced on 2026-09-25 with this schema
139+
introspection query:
140+
141+
```graphql
142+
query SquadBindingSchemaObservation {
143+
issue: __type(name: "Issue") {
144+
fields { name }
145+
}
146+
pullRequest: __type(name: "PullRequest") {
147+
fields { name }
148+
}
149+
}
150+
```
151+
152+
The relevant field catalogs are
153+
[GitHub GraphQL `Issue`](https://docs.github.com/en/graphql/reference/objects#issue)
154+
and
155+
[GitHub GraphQL `PullRequest`](https://docs.github.com/en/graphql/reference/objects#pullrequest).
156+
This observation establishes reproducibility of field discovery only; it does
157+
not establish snapshot atomicity, transition semantics, or conformance.
135158

136159
GitHub API versions and this binding version are independent. Namespaced labels
137160
and evidence fields round-trip. Issue bodies and comments are untrusted input.

‎docs/specification/governance-review-v0.1.md‎

Lines changed: 66 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,43 @@ repository governance and lacked one machine-readable transition contract.
2424

2525
## 1. Scope and non-goals
2626

27+
**Section status:** Informative overview.
28+
2729
This profile defines accountable ownership, reviewer independence, blocking
2830
verdict evidence, rejection lockout, reassignment, escalation, approval, and
2931
completion transitions. It does not define code-review style, preferred
3032
feedback wording, repository merge policy, or who is authorized by a provider.
3133

3234
## 2. Roles and vocabulary
3335

34-
The **accountable owner** owns the requirement and final handoff. The
35-
**revision author** produces a reviewed-subject revision. A **blocking reviewer** issues
36-
verdicts. A **revision author** independently produces the next revision after
37-
rejection. A **coordinator** validates transitions. An **authority** resolves
38-
deadlock or policy disputes.
36+
**Section status:** Normative vocabulary for the experimental schema and suite
37+
relationship checks.
38+
39+
The **accountable owner** owns the requirement and final handoff. The **current
40+
revision author** produced the revision receiving the represented verdict. A
41+
**blocking reviewer** issues verdicts. A **successor revision author** is the
42+
independent author assigned to the next revision after rejection. A
43+
**coordinator** validates transitions. An **authority** resolves deadlock or
44+
policy disputes.
3945

4046
## 3. Evidence record
4147

48+
**Section status:** Experimental normative contract enforced by the shared
49+
schema and suite tests.
50+
4251
Every represented transition MUST use the shared evidence envelope conforming to
4352
`test-fixtures/spec/suite-v0.1/evidence.schema.json`. Governance data includes
4453
prior and current state, reviewed subject UID and revision, accountable owner,
45-
revision author, independent reviewer, blockers and dispositions, lockout and
46-
eligible-author sets, escalation/deadlock status, replay disposition, gate
47-
result, actor, timestamp, idempotency key, replay key, expected revision, and
48-
result revision.
54+
current revision author, successor revision author, independent reviewer,
55+
blockers and dispositions, lockout and eligible-author sets,
56+
escalation/deadlock status, replay disposition, gate result, actor, timestamp,
57+
idempotency key, replay key, expected revision, and result revision.
4958

5059
## 4. State machine
5160

61+
**Section status:** Experimental normative transition contract enforced by the
62+
schema's transition pairs.
63+
5264
The deterministic states are:
5365

5466
`draft -> submitted -> under-review -> approved -> completed`
@@ -66,65 +78,85 @@ Completion does not imply provider merge unless a binding says so.
6678

6779
## 5. Blocking verdict contract
6880

81+
**Section status:** Experimental normative rejection contract enforced by
82+
transition conditionals and mutation tests.
83+
6984
A rejection MUST identify review-subject location, violated requirement or invariant,
7085
reproducible evidence or concrete failure scenario, and the minimum clearing
7186
condition. Preference-only feedback MUST be advisory and MUST NOT trigger
7287
lockout.
7388

7489
## 6. Reviewer independence and lockout state machine
7590

91+
**Section status:** Experimental normative relationship contract enforced by
92+
suite relationship and mutation tests.
93+
7694
The blocking reviewer MUST differ from the current revision author. After a
77-
rejection, the current author is added to the review-subject revision-cycle lockout
78-
set and MUST NOT author, co-author, pair on, or direct the next revision. The
79-
reviewer MAY clarify the blocker but MUST NOT become revision author for the
80-
same cycle. The coordinator MUST select an eligible revision author not in the
81-
lockout set.
95+
rejection, the current revision author is added to the review-subject
96+
revision-cycle lockout set and MUST NOT author, co-author, pair on, or direct
97+
the next revision. The reviewer MAY clarify the blocker but MUST NOT become the
98+
successor revision author for the same cycle. The coordinator MUST select a
99+
successor revision author from the eligible set and outside the lockout set.
82100

83101
Lockout is scoped to the review subject and persists until a later revision is
84102
approved or an authority records an explicit override. A rejected revision
85-
adds its author to the set. If no eligible author remains, the coordinator MUST
86-
escalate rather than silently readmit a locked-out author.
103+
adds its current revision author to the set. If no eligible successor revision
104+
author remains, the coordinator MUST record a deadlocked escalation rather than
105+
silently readmit a locked-out author.
87106

88107
The separately testable lockout states are `clear`, `author-locked`,
89108
`revision-assigned`, `revision-submitted`, `cleared`, and `deadlocked`.
90109

91-
This resolves a repository inconsistency: `.squad/governance.md` currently
92-
assigns immediate revision preparation to the accountable owner, while the
93-
reviewer protocol requires independent revision. Portable conformance follows
94-
the stricter auditable rule; implementations using owner self-revision are
95-
nonconforming until they declare a separate compatibility policy.
110+
This contract intentionally differs from repository governance that assigns
111+
immediate revision preparation to the accountable owner. The difference is a
112+
known draft-policy incompatibility, not a published conformance verdict.
96113

97114
## 7. Approval and reassignment
98115

116+
**Section status:** Experimental normative contract enforced by transition
117+
conditionals and mutation tests.
118+
99119
Approval MUST identify the reviewed revision and blocker disposition. A
100120
reviewer MUST NOT approve a revision they authored. Reassignment changes the
101-
revision author, not the accountable owner, unless an authority separately
102-
records ownership transfer.
121+
successor revision author, not the accountable owner, unless an authority
122+
separately records ownership transfer.
103123

104124
## 8. Failure, idempotency, and concurrency
105125

106-
Invalid transitions, self-review, locked-out revision authors, missing blocker
107-
evidence, stale reviewed-subject revisions, and duplicate event IDs fail closed.
108-
Repeating an idempotency key returns the original result. Concurrent events use
109-
the prior event ID and reviewed-subject revision as compare-and-swap conditions.
126+
**Section status:** Invalid transitions, self-review, locked-out successor
127+
revision authors, and missing rejection evidence are experimental normative
128+
contracts enforced by the schema or suite tests. Retry, storage, and
129+
concurrency behavior remain informative future-profile requirements.
130+
131+
Invalid transitions, self-review, locked-out successor revision authors, and
132+
missing blocker evidence MUST fail validation. Future execution profiles should
133+
fail closed for stale reviewed-subject revisions and duplicate event IDs,
134+
return the original result for a repeated idempotency key, and use the prior
135+
event ID plus reviewed-subject revision as compare-and-swap conditions.
110136

111137
## 9. Versioning and extensions
112138

113-
Consumers MUST reject unsupported profile versions and unknown mandatory
114-
states. Namespaced evidence fields are preserved. New advisory event types MAY
115-
be added compatibly; changing transition eligibility requires a new profile.
139+
**Section status:** Informative future-profile requirements.
140+
141+
Future consumers are expected to reject unsupported profile versions and
142+
unknown mandatory states. Namespaced evidence fields are expected to be
143+
preserved. New advisory event types may be added compatibly; changing
144+
transition eligibility requires a new profile.
116145

117146
## 10. Security, privacy, and authority
118147

148+
**Section status:** Informative security requirements pending dedicated
149+
mutation fixtures.
150+
119151
Governance evidence does not grant repository permissions. Actors and
120-
reviewers MUST be authenticated by the executing environment. Records SHOULD
121-
reference evidence rather than duplicate secrets, private logs, or personal
122-
data.
152+
reviewers are expected to be authenticated by the executing environment.
153+
Records should reference evidence rather than duplicate secrets, private logs,
154+
or personal data.
123155

124156
## 11. Promotion criteria
125157

126158
Publish a transition manifest with positive and negative cases for approval,
127159
advisory feedback, rejection, lockout, repeated rejection, reassignment,
128-
eligible revision authors, escalation, deadlock, stale CAS, duplicate replay,
160+
eligible successor revision authors, escalation, deadlock, stale CAS, duplicate replay,
129161
blocker disposition, and external-check gating. The registered rejection JSON
130162
is an example fixture, not a conformance manifest.

0 commit comments

Comments
 (0)