Skip to content

feat(sdd,agents): SDD-003 spec-gate + AI-019 model-tier policy#60

Merged
mlorentedev merged 1 commit into
mainfrom
feat/SDD-003-ci-spec-gate
May 20, 2026
Merged

feat(sdd,agents): SDD-003 spec-gate + AI-019 model-tier policy#60
mlorentedev merged 1 commit into
mainfrom
feat/SDD-003-ci-spec-gate

Conversation

@mlorentedev
Copy link
Copy Markdown
Owner

Summary

Two logically-distinct changes bundled by user decision (against atomic-PR ideal — conscious deviation, not scope creep) plus a small ghostty config tweak the user authored mid-session.

SDD checklist

  • Vault backlog entries exist (SDD-003-ci-spec-gate, AI-019-model-tier-policy, AUDIT-004-architecture-map)
  • Spec folders included: specs/SDD-003-ci-spec-gate/ and specs/AI-019-model-tier-policy/
  • proposal.md filled for both (Why / What / Acceptance criteria / Risks)
  • tasks.md in TDD order for both
  • verification.md filled for both with evidence + test outputs
  • features.json (SDD-003) tracks 13 features in pending state pre-merge

SDD skip rationale

Test plan

  • bats tests/*.bats645/645 pass (16 new SDD-003 cases + 4 new install-precommit cases)
  • shellcheck --severity=error scripts/*.sh setup-linux.sh clean
  • python3 JSONC validation on ai/opencode/opencode.jsonc (top-level keys + 5 MCP servers intact)
  • python3 -c "import yaml; yaml.safe_load(...)" on .github/workflows/spec-gate.yml clean
  • Self-test: this PR's diff is ≥50 LOC and contains active specs/<feature-id>/ folders → expected to PASS the spec-gate (case B)

Notable decisions

  • LOC formula: added + removed (total churn). A 100-line refactor swap should trigger the gate; SDD-001's "~50–300 LOC of production diff" wording supports this.
  • Pre-push hook, not pre-commit. Spec-gate needs branch diff against origin/main; pre-commit would falsely fail intermediate WIP commits during red-green-refactor.
  • opencode.jsonc native // comments instead of _modelTierComment JSON key — the file already uses // extensively; adding the model-tier block as comments is diff-friendly and avoids polluting the parsed JSON namespace.
  • CLAUDE.md ≤70 line threshold bumped to ≤80 with inline justification in tests/opencode.bats (model-tier addition is intentional cross-agent consistency, not slippage).
  • Gemini + Copilot model IDs marked TBD rather than guessed — speculative literal IDs rot fast.

Out of scope (for future PRs)

  • ADR-011-model-tier-policy in vault (promotion candidate noted in verification.md; ADR-010 is the natural sibling)
  • AUDIT-001 / AUDIT-002 / AUDIT-003 (queued post-merge)
  • AI-017 / AI-018 Copilot v2 schemas (Windows-empirical work)
  • Branch protection rule changes (requires admin GitHub UI; tracked separately)

Companion vault artifact

30-architecture/dotfiles-architecture-map.md (AUDIT-004) landed in the vault via Hive auto-commit ahead of this PR. Two Mermaid diagrams (setup-time + runtime data flow) + 23-row "where does X live" reference table — used as baseline for the queued AUDIT-001/002/003.

Bundle of two logically-distinct changes plus a small ghostty config tweak.
User-elected bundle (against atomic-PR ideal) — conscious deviation, not scope creep.

SDD-003 (Tier 4+5 of the SDD enforcement stack)
- scripts/check-spec-gate.sh: LOC threshold (>=50) + spec-folder presence
  check, basename-aware lockfile exclusion (npm/pnpm/go), `skip-sdd` label +
  rationale escape hatch, dependabot bypass.
- .github/workflows/spec-gate.yml: pull_request trigger, env-var pattern
  (no `${{}}` in run: blocks).
- .github/pull_request_template.md: SDD checklist + skip-rationale header.
- .pre-commit-config.yaml + scripts/install-precommit.sh --with-sdd-gate:
  opt-in pre-push hook for local pre-flight.
- tests/check-spec-gate.bats: 16 cases. tests/install-precommit.bats: +4 cases.

AI-019 (cross-agent model-tier policy)
- AGENTS.md: new "Model Selection (Task-Aware)" section between Standing
  Orders and Competence Retention Protocol. Top / Mid / Low tiers, trigger
  heuristics ("propose, don't force"), per-agent overlay pointers.
- ai/claude/CLAUDE.md, ai/gemini/GEMINI.md, ai/copilot/copilot-instructions.md,
  ai/opencode/opencode.jsonc: ~6-line Model Tier subsection each with literal
  model IDs (Claude empirical; OpenCode empirical; Gemini + Copilot marked TBD
  pending validation).
- tests/opencode.bats: CLAUDE.md threshold bumped 70->80 with inline reason.

terminal/ghostty/config: bell-features=no-system, window-vsync=true (user-authored
session tweaks, bundled at user request).

Specs at specs/SDD-003-ci-spec-gate/ and specs/AI-019-model-tier-policy/.
AUDIT-004 architecture map landed separately in the vault via Hive auto-commit.

Tests: bats 645/645 green; shellcheck --severity=error clean; opencode.jsonc
structurally valid (top-level keys + 5 MCP servers intact); JSON workflow valid.
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