feat: Doctrine v5 exemplar adoption (all 8 phases)#31
Open
aelaguiz wants to merge 4 commits into
Open
Conversation
Rally now compiles cleanly against the canonical Doctrine v5 forms, passes
per-gate review rejects, shares the work-role turn-result scaffold, and
teaches v5 canonical shapes through rally-learn. Five forward findings
(F-9 through F-13) ride as typed `# TODO(doctrine P<N>):` markers at the
P2–P7 landing sites.
Phase 1 — Enum lift in stdlib
* `RallyTurnKind` (turn_results) and `ReviewVerdict` (review_results)
lifted to top-level `export enum Name:` declarations.
* Flow-local schemas reference them with `type: EnumName`.
Phase 2 — Per-gate review rejects
* Every gate in every review contract (3 engineering + 1 poem) carries
a `reject contract.<gate> when <IssueLedger|PoemDraftFile>.<signal>`
line, closed by a final `accept "..." when contract.passes`.
* Gate signals added to flow-local `IssueLedger` / `PoemDraftFile`.
Phase 3 — Poem review contract workflow→schema
* `PoemReviewContract` converted to `schema ... sections: / gates:`.
* Three signals (`brief_mismatch`, `rationale_misfit`, `finish_rough`)
added to `PoemDraftFile` to drive per-gate rejects.
Phase 4 — review_fields shorthand confirm
* `review_family.fields:` stays as the authoritative type source.
* Reviewer agents keep the bare-name shorthand inline; a propagation
comment names the Doctrine v5 gap (no `review_fields: <SharedDecl>`)
so a future Doctrine floor bump can collapse the repeats.
Phase 5 — Shared work-role turn-result schema
* New `WorkRoleTurnResultSchema` parent in
`flows/software_engineering_demo/prompts/shared/turn_results.prompt`.
* Architect/Developer/QaDocs schemas inherit the shared base-field set
and add only their own `route field next_route:`.
Phase 6 — host_contract forward markers on skills
* Added `# TODO(doctrine F-6):` comments at the three skill env-var /
path sites (`rally-kernel`, `rally-memory`, `demo-git`). Doctrine
v5.0 only accepts the typed host_contract slot family (input/output/
document/analysis/schema/table/final_output/receipt); env-var and
scalar facts wait on a future slot family.
Phase 7 — rally-learn v5 refresh
* `turn_results_and_routing.prompt` adds the enum-typed teaching + a
canonical form code block + cross-link to Doctrine's
`outputs_and_schemas.prompt`.
* `authoring_patterns.prompt` adds a typed-gates row pointing at
`../doctrine/skills/doctrine-learn/prompts/refs/reviews.prompt`.
* `porting_anti_patterns.prompt` adds anti-pattern rows for coarse
`contract.passes` (AL450) and `type: string + enum:` (AL950).
Phase 8 — Forward markers + audit closure
* P2 `# TODO(doctrine P2): override gates` markers on the per-case
review blocks in both flows.
* P3 `# TODO(doctrine P3): typed_as:` marker on `PoemLoopSystemContext`.
* P5 `# TODO(doctrine P5): typed abstract parameters` markers on
`SoftwareEngineeringRole` and `PoemLoopRole`.
* P6 `# TODO(doctrine P6): skill mode binding` marker on
`RepoWorkSkills`.
* P7 `# TODO(doctrine P7): rule primitive` marker on
`RallyManagedSharedRules` in stdlib.
* Closure status table appended to the audit doc with per-finding
landing sites.
Doctrine pin.
The `doctrine-agents` pin stays at `>=4.0.0,<5` because Doctrine has
not yet cut a v5.0.0 release (still tagged 4.0.1). The v5 canonical
forms used here live on the editable `../doctrine` install, which
satisfies the pin locally. A future Doctrine release will unlock the
pin bump.
Verification.
* `make emit` — all 3 flows + 5 skill targets emit clean.
* `uv run pytest tests/unit -q` — 530 passed, 8 subtests passed.
* `uv lock` — clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The v5.0 adoption audit, v5.0 exemplar plan, and P2-P7 closure adoption audit + worklog all landed their frontier. `rg 'TODO(doctrine' flows stdlib skills` returns zero; Rally source now carries the v5-canonical shapes. Durable language truth lives in Doctrine's canonical homes (LANGUAGE_REFERENCE, COMPILER_ERRORS, CHANGELOG, examples 140-146). No external doc, source file, prompt, or skill references any of the four; git preserves the archival copy. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Doctrine v5.0.0 now on PyPI (aelaguiz/doctrine c67883b → release workflow run 24675109923). Unlocks the v5 canonical shapes this branch authored: enum-typed field bodies, typed `gates:` with per-case overrides, typed_as handoff identity, skill mode binding, typed abstract parameters, declarative `rule` primitive. Local verification on branch tip: - `make emit` — all 3 flows + 5 skill targets emit clean. - `uv run pytest tests/unit -q` — 624 passed, 29 subtests passed. Co-Authored-By: Claude Opus 4.7 <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
RallyTurnKindandReviewVerdictto top-levelexport enumdeclarations; every flow-local schema now references them withtype: EnumName(F-1, AL950).accept … when contract.passesinto per-gatereject contract.<gate> when …lines across all 5 reviews (F-2, AL450); adds flow-local gate signals onIssueLedger/PoemDraftFile.PoemReviewContractfrom aworkflowto aschema … sections: / gates:(F-3, AL245).WorkRoleTurnResultSchemaparent for the three engineering role schemas (F-5, AL220) and leaves a propagation comment for the per-agentreview_fields:shorthand gap (F-4).turn_results_and_routing, typed-gates row inauthoring_patterns, AL450 + AL950 rows inporting_anti_patterns.# TODO(doctrine P2|P3|P5|P6|P7):markers at the forward-finding landing sites (F-6, F-9 through F-13).Scope and non-goals
doctrine-agentspin. Doctrine is still tagged v4.0.1 and the v5 canonical forms live on the editable../doctrineinstall; the pin stays>=4.0.0,<5until Doctrine cuts a v5.0.0 release.Test plan
make emit— all 3 flows + 5 skill targets emit clean.uv run pytest tests/unit -q— 530 passed, 8 subtests passed.uv lock— clean._stdlib_smoke) — skipped locally; CI should cover if wired.Related
docs/RALLY_DOCTRINE_V5_EXEMPLAR_ADOPTION_PLAN_2026-04-19.mddocs/RALLY_DOCTRINE_V5_ADOPTION_AUDIT_2026-04-19.md🤖 Generated with Claude Code