Repository navigation
feat(model-matrix): deploy model-matrix config and meta-prompt pack to hero repos via uf init - #900
Conversation
…slice 2, unbound-force#889) OpenSpec change model-matrix-scaffold-deployment: deploy the model-matrix configuration surface to hero repos via uf init — meta-prompt pack (canonical + custom template), model-matrix- classifier subagent, AGENTS.md pack-section entries, deployed- matrix re-init ownership semantics (SC-FR-008/009/010). Spec review: APPROVE WITH ADVISORIES (dispatch 781e5975, 9 advisories recorded, no overrides).
…oyment (1.1) Comment-only revision per design D2: the header and Custom Rules notes now describe a deployed scaffold asset (issue unbound-force#889) with a meta-prompt-custom.md companion template. MP-001..MP-024 rules verified byte-for-byte unchanged; marker scan extracts zero questions; lines wrap under 72 chars.
…nt (1.2) Canonical custom-pack stub per design D2, mirroring the default-custom.md shape: frontmatter, intro prose naming the agents and commands that load it alongside meta-prompt.md (Cobalt-Crush on speckit.plan/speckit.tasks spec-authoring delegations; all Divisor personas at review), CR-NNN prefix guidance, sentinel-terminated Custom Rules section, and no version marker. Marker scan extracts zero questions; lines wrap under 72 chars. Embedded mirror sync and drift/test registration follow in tasks 2.1 and 4.1.
…1.2) Checkbox-only bookkeeping commit, made by the pipeline orchestrator under gate-timeout recovery with human consent: the cycle-3 delegation timed out after committing the template but before this mark-complete commit, and the uncommitted checkbox flip caused detect_resume to false-negative spec-review freshness, burning cycle 4 on a redundant re-approval.
…, 3.1-3.3) Checkbox-only bookkeeping commit under the orchestrator's standing-consent gate-timeout recovery: cycle 5 timed out after the fix-loop delegation landed the work commits (7a923ebc, 31a1b4f6, a0d70846, 8dc99e07) and make check went fully green at 8fe581bc, but before the child could commit these flips. Committing them keeps the tree clean so detect_resume does not false-negative spec-review freshness.
…ic deployment (4.3) Also marks tasks 4.1, 4.2, 4.7 complete in tasks.md - their work landed in the fix-loop registration unit (commits 28230d44..8fe581bc) with the full hard gate green, but the checkbox flips were not recorded.
…d packs (4.4) TestSCFR009_DeploymentCompletenessGuard parses the embedded uf/model-matrix.yaml packs: keys and fails naming each missing internal/scaffold/assets/opencode/uf/packs/<key>.md mirror - the regression guard for the slice-1 gap (MATRIX_INVALID on load).
… (4.6) TestRun_ModelMatrixPreservedOnRerun covers all four SC-FR-010 scenarios: new-file seeding, plain re-init preservation of the team-edited matrix and custom template, tool-owned refresh of the schema registry and canonical pack, and the --force replace path.
…rship semantics (5.1)
Persist the five Dewey knowledge artifacts produced during the model-matrix scaffold deployment review cycles (issue unbound-force#889): - review-dispatch: verify embedded-asset byte-identity via diff index blob hashes (RD-FR-032) - scaffold-security: ownership flips to project-owned config are safe only with fail-closed load-time validation - scaffold-testing: guard-test pattern for embed-FS template reference closure - spec-authoring: re-verify task-number cross-references after tasks.md phase reorganization - test-quality: explicit negative assertions for invariant bullets that lack scenarios Assisted-by: glm-5 Generated with AI assistance (glm-5)
jflowers
left a comment
There was a problem hiding this comment.
Review Verdict: APPROVE WITH ADVISORIES
The Divisor review council (5 reviewers — adversary, architect, curator, guard, testing, all enmaas/rits/zai-org/glm-5-3) reviewed all 23 changed files (+2016/−53) against base 3abf946. All five reviewers returned APPROVE WITH ADVISORIES; CI is fully green (18 checks, 0 failures, 0 pending). Dispatch correlation: b2c94d31-639d-4381-9419-12eb91e8e011.
Findings: 10 unique (17 raw, deduplicated by file + root cause) — 2 MEDIUM, 8 LOW, 0 blocking. The 9 file-anchored findings are posted as inline comments. One MEDIUM finding has no single line anchor and is recorded here:
- [MEDIUM] Content-coverage disposition missing (divisor-curator,
openspec/changes/model-matrix-scaffold-deployment/proposal.md, Impact section) — The proposal dispositions the documentation gate (#899, unbound-force/website#362) but carries no content-coverage (blog/tutorial) disposition. This deployment slice is what makes the model-matrix epic (#887–#889) reach consumers —uf initnow deploys the matrix, the hidden classifier agent, and the meta-prompt pack to every hero repo — meeting the new-agent-on-the-deployed-surface blog significance threshold, yet no blog-labeled issue tracks model-matrix (verified: only #742 and #423 carry the blog label). Recommendation: file a blog issue for the capability epic (suggested title: "blog: the model matrix — capability-driven model selection for every hero repo"), or add an explicit assessed-and-declined disposition bullet to proposal.md naming the threshold applied.
Advisory highlights:
- The task-5.4 → 6.1 cross-reference drift in proposal.md is the only finding flagged independently by three reviewers; the fix is a two-line edit.
- The path-concatenation advisory on TestSCFR009 (divisor-adversary) is rebutted by two sibling reviewers' path-domain analysis: embed.FS virtual keys are forward-slash-only and
filepath.Joinwould break lookups on Windows — the concatenation matches the productionassetContentseam. Reasonable to close as won't-fix. - Prior councils' unresolved advisories were re-verified this round; all stand except the rebutted path-concatenation flag.
Constitution compliance: verified — no gate configuration (coverage thresholds, CI flags, review limits, pinned versions) is touched by any of the 23 files; the guard confirms the implementation matches SC-FR-008/009/010 acceptance criteria.
Verdict justification: no blocking findings; all advisories are documentation-accuracy, test-observability, or deliberately deferred (design D5) trade-offs with trivial or documentation-only fixes. The deployment implementation — byte-identical embedded mirrors, the isToolOwned ownership flip, and the new guard/lifecycle tests — is solid and fully CI-verified.
This review was generated by /uf.review-pr (AI-assisted).
| <!-- originating_issue: 889 is recorded in .openspec.yaml; | ||
| /uf.finale emits `Closes #889` in the PR body. The repo | ||
| documentation issue filed per the AGENTS.md documentation | ||
| gate (task 5.4) and the cross-repo `unbound-force/website` |
There was a problem hiding this comment.
[MEDIUM] The proposal cites task 5.4 for the documentation-issue filing here and again in the Impact section's Documentation gate bullet, but tasks.md numbers that task 6.1 inside Phase 6; Phase 5 ends at 5.3. The dangling reference misdirects anyone tracing the documentation gate and breaks the proposal-to-tasks traceability MP-016 exists to provide. Replacing both "task 5.4" references with "task 6.1" closes the gap. (divisor-architect, divisor-curator, divisor-guard)
| sort.Strings(keys) | ||
|
|
||
| for _, key := range keys { | ||
| packAsset := "opencode/uf/packs/" + key + ".md" |
There was a problem hiding this comment.
[LOW] TestSCFR009_DeploymentCompletenessGuard joins the pack asset path by string concatenation ("opencode/uf/packs/" + key + ".md"), which go.md SC-003 flags for filesystem path construction. Blast radius is negligible here: keys come from the drift-enforced embedded template and assetContent only reads from the embed.FS (a "../x" key fails the lookup fail-closed). Two sibling reviewers' lesson proposals rebut the flag on path-domain grounds — embed.FS keys are forward-slash-only and filepath.Join would break lookups on Windows; the concatenation matches the production assetContent seam. Consider closing as won't-fix, or adding a short comment noting the embed.FS path domain. (divisor-adversary)
| is DivisorOnly-only), and `meta-prompt` is the one mapped | ||
| pack absent from the embedded set — so hero repos | ||
| scaffolded from current `main` receive a matrix that cannot | ||
| load. `internal/schemas/packvalidator_test.go` and |
There was a problem hiding this comment.
[LOW] The Context section states packvalidator_test.go and knownNonEmbeddedFiles both carry slice-1 deferral entries for meta-prompt.md and model-matrix-classifier.md. Only knownNonEmbeddedFiles carried those markers; packvalidator_test.go's meta-prompt.md skip (lines 203-211) is a permanent format-based exemption with no #889/SC-FR-007 marker, and it carries no classifier entry at all. A future reader auditing slice-1 deferrals from this citation will not find them where cited. Splitting the sentence into the two distinct skip mechanisms restores accuracy. (divisor-architect, divisor-guard)
| ## Unreleased | ||
|
|
||
| ### Added | ||
| - model-matrix-scaffold-deployment: `uf init` now deploys the |
There was a problem hiding this comment.
[LOW] The Unreleased entry cross-references the spec directory and Fixes: #889 but omits the documentation issues the change filed: #899 (repo docs) and unbound-force/website#362 (website docs). Those issues are the discovery path for the documentation work this user-facing change requires. Appending "Docs: #899, unbound-force/website#362" to the closing cross-reference line closes the gap. (divisor-curator)
| threshold. `git diff --name-only c95ea4a5...HEAD` touches | ||
| no gate config — coverage-gate.json, | ||
| .opencode/vitest.config.ts, and .github/workflows/* are | ||
| absent from the 17-file change set — and the test-file |
There was a problem hiding this comment.
[LOW] notes.md records the constitution-verification gate as covering a 17-file change set; the merged PR carries 23 files (the six retrospective learnings joined after the note was written). The substantive claim — no gate configuration touched — remains true for all 23 files; only the count is stale. Updating to 23, or citing the verified paths directly, keeps the audit record accurate. (divisor-architect, divisor-curator, divisor-guard)
| t.Fatalf("read %s: %v", label, err) | ||
| } | ||
| if !bytes.Equal(got, want) { | ||
| t.Errorf("%s content mismatch: got %d bytes, want %d bytes", |
There was a problem hiding this comment.
[LOW] The assertContent helper verifies content exactly (bytes.Equal) but its failure message reports only byte counts ("%s content mismatch: got %d bytes, want %d bytes"). A same-length divergence — a wrong asset deployed, or a marker at a different position — prints identical counts and leaves the debugging agent with no signal about what or where the difference is. Reporting the first-differing byte offset, or a bounded head/tail excerpt of both payloads, would surface the actual regression. (divisor-testing)
| "ci-custom": true, | ||
| "review-voice": true, | ||
| "review-voice-custom": true, | ||
| "meta-prompt": true, |
There was a problem hiding this comment.
[LOW] This change extends the dual encoding of the always-deployed pack set — alwaysDeployedPacks (extension-less keys) and collectDeployedPacks (.md filenames) — with two meta-prompt entries each. Every future always-deployed pack must now be registered in both places; omitting one silently diverges deploy behavior from the AGENTS.md pack listing. Design D5 documents the deferral and TestShouldDeployPack/TestCollectDeployedPacks_* pin both lists, so this is an accepted, test-mitigated trade-off; the structural fix (single source of truth) is worth tracking for a future governance change. (divisor-architect)
| // copy (scenario 2), and byte-identical copies produce no spurious | ||
| // updates (scenario 3). The user-owned meta-prompt-custom.md | ||
| // template is never overwritten once deployed. | ||
| func TestRun_ModelMatrixPreservedOnRerun(t *testing.T) { |
There was a problem hiding this comment.
[LOW] SC-FR-010 bullet 4 requires *-custom.md packs and the gitignored .uf/model-matrix.override.yaml to remain preserved on re-init. TestRun_ModelMatrixPreservedOnRerun covers the *-custom.md half (customOut asserted Skipped with edited content unchanged), but no test asserts the override file survives a re-init — no test references model-matrix.override.yaml at all. The invariant currently holds structurally (no embedded override asset exists), but the MUST clause is unpinned: a future tool-owned override template would silently clobber team overrides with no failing test. An explicit preserved-override assertion closes the traceability gap. (divisor-testing)
| to slice 2. SC-FR-008 through SC-FR-010 are allocated here; | ||
| SC-FR-011 through SC-FR-018 remain reserved for future scaffold | ||
| changes. Sibling capabilities: matrix loading and selection | ||
| semantics live in specs/model-matrix/spec.md (MM-FR-001 through |
There was a problem hiding this comment.
[LOW] The allocation header records sibling capability requirements at specs/model-matrix/spec.md and specs/unleash/spec.md; neither path resolves in the tree (specs/ holds only numbered Speckit directories 001–036; openspec/specs/ holds review-council, ci, graphthulhu-distribution). The MM-FR requirements actually live in the unarchived slice-1 delta at openspec/changes/model-matrix-delegation/specs/model-matrix/spec.md. Citing the path that resolves — or noting it resolves post-archive — restores the header's cross-referencing purpose. (divisor-architect, divisor-curator, divisor-guard)
Summary
Deployed the model-matrix configuration surface (slice 1, #887) to hero repos via
uf init, closing the slice-1 gap where a freshly scaffolded repo's tracked.uf/model-matrix.yamlnamed themeta-promptpack with no pack file — making everyuf_delegate_commandfail non-retryably withMATRIX_INVALID. What ships:.opencode/uf/packs/meta-prompt.mdgains a byte-identical embedded mirror;alwaysDeployedPacksandcollectDeployedPacksentries deploy it regardless of detected language (full and DivisorOnly modes) and list it in scaffolded AGENTS.md; its two self-describing comments revised for deployed status, MP-001 through MP-024 rules unchanged.meta-prompt-custom.mdtemplate: user-owned initial-deployment template following the*-custom.mdpattern — seeded once, never overwritten, drift-exempt by the custom-pack skip rule..opencode/agents/model-matrix-classifier.mdmirrored so hero repos get the agent-engine half of the classifier cascade instead of silently degrading to static defaults (user-owned on re-init, deny-all permissions)..uf/model-matrix.yamlis reclassified as a team-owned extension point (isToolOwnedflip, the Added review agents surviveuf initin review-matrix.yaml but not reviewer-capabilities.yaml #884/docs: reviewer-capabilities.yaml survives plain uf init re-runs (reviewer-capabilities-init-survival) #886 review-matrix precedent) — team edits survive plain re-init,--forcereplaces, fresh deploys seed the template; the.uf/schemas/model-matrix/registry and canonical packs stay tool-owned and refresh on diff.TestSCFR009_DeploymentCompletenessGuardparses the embedded template and fails naming anypacks:key without an embedded pack file — the regression test that would have caught the slice-1 gap.TestRun_ModelMatrixPreservedOnRerun, fresh-deploy parity assertions),docs/configuration.md"Scaffold deployment" subsection with the re-init ownership table and healing note, CHANGELOG entry, AGENTS.md convention-pack list. Documentation issues filed per the gate: docs: model-matrix scaffold deployment via uf init (model-matrix-scaffold-deployment) #899 and docs: model-matrix-scaffold-deployment — uf init deploys the model-matrix surface to hero repos website#362.Repos scaffolded during the slice-1 window (invalid matrix naming
meta-prompt) are healed by re-runninguf init: the pack deploys as a new file regardless of ownership, making the existing matrix valid.Closes #889
How to Test
Full CI-parity gate (fresh green at final head
79f1596f):Targeted scenario tests, mapped to the spec delta:
End-to-end manual scenario (acceptance criteria 1-2):
go run ./cmd/unbound-force init /tmp/hero-test— the created list must include.uf/model-matrix.yaml,.uf/schemas/model-matrix/v1.schema.json,.opencode/uf/packs/meta-prompt.md,.opencode/uf/packs/meta-prompt-custom.md, and.opencode/agents/model-matrix-classifier.md./tmp/hero-test/.uf/model-matrix.yaml(add a profile) andmeta-prompt-custom.md(add a CR rule), then re-run plainuf init /tmp/hero-test— both files must be skipped with content unchanged, while tool-owned files with differing content update.--force— the team-edited matrix is replaced with the embedded template.How to Demo
go run ./cmd/unbound-force init /tmp/hero-demoon an empty directory and show the created-file list:.uf/model-matrix.yaml,.uf/schemas/model-matrix/v1.schema.json,.opencode/uf/packs/meta-prompt.md,.opencode/uf/packs/meta-prompt-custom.md,.opencode/agents/model-matrix-classifier.md./tmp/hero-demo/.uf/model-matrix.yamland a CR rule tometa-prompt-custom.md; re-run plainuf init /tmp/hero-demo— both edited files are reported skipped with content unchanged, tool-owned files refresh on diff.--force— the team-edited matrix is replaced by the embedded template (documented escape hatch).Key Files Changed
Known Issues
Review councils approved with advisories (spec review: APPROVE WITH ADVISORIES, 4 advisories; code review: APPROVE WITH ADVISORIES, 5/5 Divisor reviewers, 11 advisory findings, pre-flight PASS 4/4). Unresolved advisories, compactly:
openspec/changes/model-matrix-scaffold-deployment/proposal.mdcites nonexistent task "5.4" (actual task is 6.1) — documentation cross-reference nit.TestSCFR009_DeploymentCompletenessGuard(adversary;embed.FSfails closed — stylistic).alwaysDeployedPacks/collectDeployedPacksdual encoding (architect; deliberate deferral recorded in design D5).packvalidator_test.goformat-skip withknownNonEmbeddedFilesdeferrals (adversary/guard).notes.mdsays 17-file change set; final is 18+ (guard).meta-prompt.mdMP-022 referencesdeterminism.md, not yet deployed to hero repos (guard; accepted degradation per design).filterEmptyCustomPacksbehavior (adversary).specs/model-matrix+specs/unleashpaths (adversary).assertContenthelper reports byte-count-only mismatch messages (testing).This PR was generated by /uf.finale (AI-assisted).