Skip to content

feat: Doctrine v5 exemplar adoption (all 8 phases)#31

Open
aelaguiz wants to merge 4 commits into
feat/rally_perffrom
feat/doctrine_v5_adoption_on_perf
Open

feat: Doctrine v5 exemplar adoption (all 8 phases)#31
aelaguiz wants to merge 4 commits into
feat/rally_perffrom
feat/doctrine_v5_adoption_on_perf

Conversation

@aelaguiz

Copy link
Copy Markdown
Owner

Summary

  • Lifts stdlib RallyTurnKind and ReviewVerdict to top-level export enum declarations; every flow-local schema now references them with type: EnumName (F-1, AL950).
  • Expands coarse accept … when contract.passes into per-gate reject contract.<gate> when … lines across all 5 reviews (F-2, AL450); adds flow-local gate signals on IssueLedger / PoemDraftFile.
  • Converts PoemReviewContract from a workflow to a schema … sections: / gates: (F-3, AL245).
  • Extracts WorkRoleTurnResultSchema parent for the three engineering role schemas (F-5, AL220) and leaves a propagation comment for the per-agent review_fields: shorthand gap (F-4).
  • Teaches v5 canonical shapes through rally-learn (F-7): enum-typed section in turn_results_and_routing, typed-gates row in authoring_patterns, AL450 + AL950 rows in porting_anti_patterns.
  • Drops typed # TODO(doctrine P2|P3|P5|P6|P7): markers at the forward-finding landing sites (F-6, F-9 through F-13).
  • Appends a closure-status table to the adoption audit doc, one row per finding.

Scope and non-goals

  • Does not bump doctrine-agents pin. Doctrine is still tagged v4.0.1 and the v5 canonical forms live on the editable ../doctrine install; the pin stays >=4.0.0,<5 until Doctrine cuts a v5.0.0 release.
  • No runtime / CLI / test harness changes beyond what the authoring edits demand.
  • No new flows, skills, or agents.

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.
  • Fixture behavior-preservation on reviews (pre/post verdict diff on _stdlib_smoke) — skipped locally; CI should cover if wired.

Related

  • Plan: docs/RALLY_DOCTRINE_V5_EXEMPLAR_ADOPTION_PLAN_2026-04-19.md
  • Audit: docs/RALLY_DOCTRINE_V5_ADOPTION_AUDIT_2026-04-19.md

🤖 Generated with Claude Code

aelaguiz and others added 4 commits April 19, 2026 21:18
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>
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.

1 participant