Skip to content

feat: implement The Divisor PR Reviewer Council (Spec 005) - #42

Merged
jflowers merged 2 commits into
mainfrom
005-the-divisor-architecture
Mar 20, 2026
Merged

jflowers merged 2 commits into
mainfrom
005-the-divisor-architecture

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

  • Implement the full Divisor PR Reviewer Council architecture per Spec 005
  • 5 canonical divisor-*.md persona agents with dynamic discovery and convention pack loading
  • Scaffold engine extended with --divisor subset deployment and --lang language override
  • All 44 tasks complete, all tests pass, 85.1% coverage

What Changed

New Files (27)

Divisor Persona Agents (5):

  • .opencode/agents/divisor-{guard,architect,adversary,sre,testing}.md — project-agnostic agents that load convention packs dynamically at review time

Convention Packs (6):

  • .opencode/divisor/packs/{go,default,typescript}.md — canonical rule sets (tool-owned, auto-updated)
  • .opencode/divisor/packs/{go,default,typescript}-custom.md — project-specific extensions (user-owned)

Embedded Asset Copies (12):

  • internal/scaffold/assets/opencode/ mirrors of all new canonical files

Spec Artifacts (6):

  • specs/005-the-divisor-architecture/{plan,tasks,data-model,research,quickstart,contracts/scaffold-cli}.md

Modified Files (12)

Scaffold Engine (internal/scaffold/scaffold.go):

  • Options struct: added DivisorOnly, Lang fields
  • New functions: isDivisorAsset(), detectLang(), shouldDeployPack(), isConventionPack()
  • Updated isToolOwned() for convention pack ownership (canonical = tool-owned, custom = user-owned)
  • Updated printSummary() for divisor mode label and language-detection warning
  • Run(): DivisorOnly filtering, language resolution, pack selection

CLI (cmd/unbound/main.go):

  • --divisor flag: deploy only Divisor agents and packs
  • --lang flag: override language auto-detection

Tests (internal/scaffold/scaffold_test.go):

  • 8 new test functions: TestIsDivisorAsset, TestDetectLang, TestShouldDeployPack, TestRun_DivisorSubset, TestRun_DivisorSubset_WithLangFlag, TestRun_DivisorSubset_DefaultFallback, plus 2 printSummary divisor mode subtests
  • Updated expectedAssetPaths (33 → 45), knownNonEmbeddedFiles, canonicalDirs

Commands:

  • review-council.md: discovery pattern changed from reviewer-*.md to divisor-*.md
  • speckit.testreview.md: references divisor-testing instead of reviewer-testing

Documentation:

  • AGENTS.md: hero table, project structure, recent changes
  • README.md: file count, Divisor status, --divisor/--lang docs
  • unbound-force.md: five personas, embedded distribution

Review Council Results

All 5 Divisor personas reviewed this implementation. Initial findings addressed in iteration 1:

  • README/AGENTS.md documentation gaps (fixed)
  • Language-detection silent fallback (fixed — now emits warning)
  • Double version markers in convention pack stubs (fixed)
  • printSummary divisor mode test coverage (fixed)

Pre-existing findings (not from this change) deferred: os.Chdir in test, SyncProject stub, insertMarkerAfterFrontmatter allocation pattern.

Success Criteria

SC Status
SC-001 Protocol documented PASS
SC-002 Go pack matches prototype PASS
SC-003 Default pack provides universal coverage PASS
SC-004 unbound init --divisor produces correct output PASS
SC-005 --lang typescript selects TS pack PASS
SC-006 Structured Markdown report PASS
SC-007 Iteration protocol terminates correctly PASS
SC-008 Project-aware review produces targeted findings PASS

Closes #8, #9, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19

Implement the full Divisor architecture: 5 canonical divisor-*.md
persona agents (Guard, Architect, Adversary, SRE, Testing) with
dynamic discovery, 6 convention pack files loaded at review time,
scaffold engine extensions for --divisor subset deployment and
--lang language override, and updated /review-council command.

Key changes:
- 5 new divisor-*.md agents in .opencode/agents/ (project-agnostic)
- 6 convention packs in .opencode/divisor/packs/ (Go, TS, default + custom stubs)
- review-council.md updated: divisor-*.md discovery pattern
- scaffold.go: isDivisorAsset(), detectLang(), shouldDeployPack(),
  isConventionPack(), DivisorOnly/Lang options, language detection
- main.go: --divisor and --lang CLI flags on unbound init
- 8 new test functions covering all scaffold behaviors
- 12 new embedded assets (45 total, was 33)
- Spec artifacts: spec.md, plan.md, tasks.md, data-model.md,
  research.md, quickstart.md, contracts/scaffold-cli.md

All 44 tasks complete. All tests pass. Coverage: 85.1%.
@jflowers jflowers added enhancement spec-005 Spec 005: The Divisor Architecture phase-1 Phase 1: Hero Architectures labels Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase-1 Phase 1: Hero Architectures spec-005 Spec 005: The Divisor Architecture

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Setup: Create convention pack directory structure

1 participant