Commit Graph

8 Commits

Author SHA1 Message Date
Bastien Chanot
09f5b28d99 feat(doc-sync): MINOR-shape oracle + fail-loud commit (strengthen MINOR gate)
(1) lib/doc-shape.sh — deterministic shape oracle re-checks each LLM-classified
MINOR patch before the silent auto-commit; a shape-suspect patch (added heading
/ oversize / new file / non-doc) escalates to the EXISTING SIGNIFICANT gate.
Genuine MINOR still auto-commits (zero friction, BDR-036 preserved). A structural
floor under the LLM call, not a semantic SIGNIFICANT-detector (BDR-040).

(2) lib/doc-commit.sh — guard the commit itself: a rejected git commit (pre-commit
hook / protected branch / signing) now fails loud with exit 5 + empty stdout,
instead of a false "committed" + the previous HEAD's hash + exit 0 that left docs
silently uncommitted (LRN-071, 3rd occurrence of the swallowed-commit pattern
after LRN-066 and LRN-068/BLK-012).

Wired doc-syncer STEP A4 (whole-set escalation: no=revert all, select=keep subset)
+ doc-commit.md (rc-5 consumer row + ACKNOWLEDGMENTS coherence).
TDD RED->GREEN: run-doc-commit.sh 32/32, run-doc-shape.sh 19/19, behavioral C/D.
shellcheck clean. Branch-guard (3) deferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C6bUdvHnajCNzgVQefZowj
2026-06-29 17:41:24 +02:00
Bastien Chanot
fb1f359da5 feat(doc-syncer): PATCHED_FILES newline output for doc-commit handoff
doc-syncer now emits PATCHED_FILES — every public-doc file created/modified this run, ONE PATH PER LINE — in both STEP 9 OUTPUT (full audit) and AUTO MODE STEP A4 (the path orchestrators call). NONE stays silent (no line → doc-commit sees empty → no-ops). Additive: detection/patching logic and the `auto-mode scope:` input contract are unchanged → callers unaffected.

Separator contract, producer↔consumer aligned + proven: newline is doc-syncer's OUTPUT format (paths carry no newlines); the agent splits on newline and passes EACH path as a SEPARATE argv element to lib/doc-commit.sh. The helper takes argv (no in-band separator) → a path with spaces survives as one argument. lib/doc-commit.md spells this out (never flatten to a space-joined string + re-split, which would mis-split a spaced path the helper then silently drops). New test T7 PROVES it on real git: 'docs/My Guide.md' → committed as one file (28/28, shellcheck clean).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ho5EQCFTSvYamuRtVZpp2d
2026-06-27 01:07:03 +02:00
Bastien Chanot
35536bf1ed feat(doc-syncer): sync-only ROADMAP handling + shipped reconciliation
Teach doc-syncer to sync an existing ROADMAP.md without ever creating one.

- ROADMAP absent → propose nothing; never bootstrapped (creation belongs
  to init/onboard skills). Never enters DOC_MISSING, never a CREATE
  candidate.
- ROADMAP present → standard drift detection plus 'shipped reconciliation':
  a planned/unchecked item proven delivered by CODE + git is proposed for
  the shipped/done section (or checkbox), preserving wording. [AUTO] when
  the item-to-code mapping is obvious, [HUMAN] when it needs judgment.
  One direction only (planned -> shipped); never invent planned items.
- Forbid reading .claude/tasks/ (or any .claude/) to populate or check
  ROADMAP; shipped status is deduced from code/git only.
- Numeric incoherence (e.g. a '22/22' milestone matching no code counter)
  is surfaced as a [HUMAN] question, never overwritten with a guess.

Implements BDR-022's read-only .claude/ boundary for the ROADMAP case.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-19 12:39:18 +02:00
Bastien Chanot
edff761fc4 refactor(doc-syncer): scope to public docs, .claude read-only, conventions + clean mode
Rewrite the doc-syncer agent so it only ever targets public docs and
treats .claude/ (and CLAUDE.md) as read-only context.

- Add normative CONVENTIONS section: Standard-Readme, Diátaxis doc-type
  separation, Keep a Changelog + SemVer, Conventional Commits.
- Add CONTEXT SOURCES section: .claude/ and CLAUDE.md may be read for
  project context but are never modified, never sync targets, and their
  content is never copied into a public doc.
- Drop .claude/{tasks,audits,memory} and CLAUDE.md from discovery,
  per-doc analysis, tagging, patches, and the report. Remove the STEP 4
  blocks that audited TODO.md / audits/*.md / decisions-learnings-blockers.
- Fix sync scope to the modifiable targets: README, INSTALL, CONFIGURE,
  USAGE, DEPLOY, CONTRIBUTING, CHANGELOG, SECURITY, ARCHITECTURE, LICENSE,
  docs/**. Add SECURITY.md and ARCHITECTURE.md analysis stanzas.
- Make the README template lean (Standard-Readme order): drop Status and
  Project layout; forbid roadmap/todo/internal-state; README only links
  to the Diátaxis docs, never duplicates them.
- Add CLEAN mode (triggered by a 'clean' arg): propose removal of
  out-of-convention sections and copied .claude/ content from existing
  public docs, HUMAN-tagged and gate-validated.
- Conserve: stack detection, 14-section DEPLOY gate, validation gate,
  AUTO/HUMAN tagging, never-invent rule, AUTO MODE (input contract
  'auto-mode scope:' unchanged, so callers are unaffected).
- Preserve frontmatter name/tools/model; update description to reflect
  the public-doc scope and 'reads .claude/ for context only'.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-18 17:46:48 +02:00
bastien
58f1e7e458 feat(doc-syncer): README mandatory + 14-section prod-only DEPLOY.md
README.md creation becomes AUTO and unconditional — strikes through any
"no README" opt-out in CLAUDE.md. Enriched template: Stack, Quick start
(dev), Verifying a change, Build & deploy sections, all rendered from
real project data (manifest, .env.example, scripts).

DEPLOY.md becomes prod-only, expanded into a 14-section VPS-deploy
structure (topology, env, provisioning, two-layer firewall, Docker
tuning, first-time setup, routine deploys, persistence, backups, TLS,
observability, hardening, rollback, runbook). Dev quick-start lives in
README only — mixed dev/prod DEPLOY.md is flagged as drift.

AUTO MODE: missing README surfaced as SIGNIFICANT in STEP A4 with
rendered draft for one-shot end-of-session approval. Validation gate
(STEP 8) now distinguishes AUTO patches / HUMAN items / CREATE items,
and README CREATE has no "no" — only yes/edit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 22:21:13 +02:00
bastien
b2a5b5a602 feat(doc-syncer): stack-aware audit with deploy-doc gating
Auto-discover what the project actually has instead of a fixed doc list:
root files (incl. DEPLOY.md, SECURITY.md, ARCHITECTURE.md, ROADMAP.md),
docs/**, and .claude/{tasks,audits,memory}/.

Detect stack (Node/Python/Rust/Go/Ruby/PHP/Dart/.NET) and deploy
complexity (NONE/TRIVIAL/NON_TRIVIAL) to drive doc-needs:
- Propose DEPLOY.md only when non-trivial (Docker, fly.toml, k8s,
  multi-stage CI).
- Propose inlining/removing DEPLOY.md when deploy is trivial.
- Enforce README presence with typical GitHub layout.

Add CREATE/REMOVE proposal categories to the validation gate. Update
auto-mode to map deploy artifacts to DEPLOY.md and decisions.md
architectural changes back to CLAUDE.md/README.

Sync skills/doc/SKILL.md description + triggers to match.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 17:09:12 +02:00
bastien
0bbb13f1f2 feat(doc-syncer): add feature delta detection — track added/removed features
Doc syncer now detects features present in code but missing from docs
(ADDED) and features documented but removed from code (REMOVED). Both
full audit and auto mode updated. Tags follow AUTO/HUMAN rules: list
entries are AUTO, new sections and deprecation notes are HUMAN.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-15 23:21:45 +02:00
bastien
0241e1ddc8 refactor(skills): extract skill logic into standalone agent files
Skills now delegate to agent .md files instead of embedding logic
inline. Added new agents (bugfixer, code-cleaner, commit-changer,
doc-syncer, feater, hotfixer, seo-analyzer) and new skills
(code-clean, doc, seo). Replaced /readme with /doc (broader scope).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-15 20:18:34 +02:00