You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hardens the Spec-Layer that landed in v3.16+ as a skeleton (NewSpecCmd() in cmd/sin-code) into a production-grade SOTA feature.
Why
The Spec-Layer is the missing link between Learning and Verification. Without it, the Instinct subsystem can drift silently: an Instinct embeds a behavior that the original .spec.md no longer guarantees. With it, every change has a contract that the CI enforces.
What ships in this epic
1. Pre-commit drift detection
A pre-commit hook (scripts/spec-drift-check.sh) that runs on every git commit and:
Reads every .spec.md in the repo
For each spec, parses the contract: "function X accepts Y, returns Z, raises E"
Greps the code for the actual signature
Reports any drift as a warning (or error, depending on .sin-code.yml policy)
2. CI gate
Extend lint-and-security/golangci-lint (or a new spec-ci workflow) to run the same check on every PR. A spec drift that the developer didn't fix pre-commit blocks the merge.
3. Self-authoring mode
sin spec author "Add rate limiting to API" runs:
A Planner LLM call → generates .spec.md with the contract
An Implementer LLM call → writes the code
The verify gate → checks spec vs code
On mismatch, retry up to 3 times
Acceptance criteria
scripts/spec-drift-check.sh exits 0 on a clean repo, 1 on drift
A .sin-code.yml policy key spec.drift: error|warn|off controls the strictness
sin spec author "<description>" produces a working PR with both spec + code
Spec-Layer Hardening
Hardens the Spec-Layer that landed in v3.16+ as a skeleton (
NewSpecCmd()incmd/sin-code) into a production-grade SOTA feature.Why
The Spec-Layer is the missing link between Learning and Verification. Without it, the Instinct subsystem can drift silently: an Instinct embeds a behavior that the original
.spec.mdno longer guarantees. With it, every change has a contract that the CI enforces.What ships in this epic
1. Pre-commit drift detection
A pre-commit hook (
scripts/spec-drift-check.sh) that runs on everygit commitand:.spec.mdin the repo.sin-code.ymlpolicy)2. CI gate
Extend
lint-and-security/golangci-lint(or a newspec-ciworkflow) to run the same check on every PR. A spec drift that the developer didn't fix pre-commit blocks the merge.3. Self-authoring mode
sin spec author "Add rate limiting to API"runs:.spec.mdwith the contractAcceptance criteria
scripts/spec-drift-check.shexits 0 on a clean repo, 1 on drift.sin-code.ymlpolicy keyspec.drift: error|warn|offcontrols the strictnesssin spec author "<description>"produces a working PR with both spec + codeast), JSON SchemaMandates
spec-ciworkflow is n8n-delegated, not directcmd/sin-code/internal/spec/Related
docs/PRP-WORKFLOW.md— PRPs are how spec-driven changes are trackedinternal/verify/— the verify engine is what consumes the specEstimated scope
~3000 LOC, 2-3 PRs, 2-3 weeks. Bumps the spec to v3.18.0.