Semantic Harness follows a four-phase workflow:
init → discover → review → refine → baseline
Each phase produces versioned artifacts in docs/fact/. The architect (you) controls convergence through feedback and acceptance.
Run init to create the workspace:
docs/fact/
schemas/ — artifact schema definitions
discovery/ — versioned working artifacts
review/ — review summary, architect feedback
baseline/ — accepted baseline (immutable)
Important: These directories contain generated semantic state, not human-written documentation. The pipeline writes artifacts here at runtime.
schemas/defines the structural contracts each artifact must satisfy. Human-written design docs are indocs/semantic-design/.
Discovery extracts semantic understanding from your repository:
- Samples the repository structure
- Extracts repo facts with evidence
- Identifies domain candidates
- Builds repo understanding (purpose, pipelines, concepts)
- Assesses knowledge confidence
- Generates review summary
Output artifacts (versioned):
discovery/repo-facts.vN.mddiscovery/domain-candidates.vN.mddiscovery/repo-understanding.vN.mddiscovery/knowledge-confidence.vN.mdreview/review-summary.vN.md
After discovery, review the outputs and write feedback:
- Read
review/review-summary.vN.md - Edit
review/architect-feedback.mdwith corrections, missing concepts, clarifications - Run
refine— patches artifacts using your feedback - Review the updated artifacts and
review/semantic-change-log.md - Repeat until satisfied
When artifacts are ready, add to architect-feedback.md:
acceptance: true
Run refine again. The system will:
- Verify 4 structural gates (acceptance field, knowledge-confidence sections, repo-understanding sections, domain-candidates non-empty)
- Synthesize baseline artifacts:
purpose.md,domains.md,concepts.md,pipelines.md - Write
baseline/checkpoint.jsonwith source version traceability
Baseline artifacts are immutable and never auto-pruned.
| Artifact | Location |
|---|---|
| Sampling report | discovery/sampling-report.md |
| Repo facts | discovery/repo-facts.vN.md |
| Domain candidates | discovery/domain-candidates.vN.md |
| Repo understanding | discovery/repo-understanding.vN.md |
| Knowledge confidence | discovery/knowledge-confidence.vN.md |
| Review summary | review/review-summary.vN.md |
| Architect feedback | review/architect-feedback.md |
| Change log | review/semantic-change-log.md |
| Baseline | baseline/{purpose,domains,concepts,pipelines}.md |
| Checkpoint | baseline/checkpoint.json |
All paths are relative to docs/fact/.
The system halts safely on errors:
- Validation failure: artifact missing required schema sections → pipeline stops, prior valid artifacts preserved
- Version skew: cross-artifact version inconsistency detected → pipeline halts before any writes
- Executor failure: malformed output → staged writes prevent partial state, nothing committed
- Baseline failure: incomplete synthesis output → baseline not written, working state intact
After any failure, fix the issue and rerun. The system recovers from the last valid state.
- Review artifacts after each discovery/refine cycle
- Write specific, actionable feedback in
architect-feedback.md - Only add
acceptance: truewhen you're confident in the semantic model - Keep feedback focused on corrections and missing knowledge, not style
- Check
semantic-change-log.mdto track what changed between refine cycles