Skip to content

Commit b15e908

Browse files
librarian: sync missing CLI help blocks in reference docs 📚
1 parent 87fc5a0 commit b15e908

6 files changed

Lines changed: 1011 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Decision
2+
3+
## Options considered
4+
### Option A (recommended)
5+
Update the documentation to match the current CLI schema using `cargo xtask docs --update`.
6+
- Fits the `tooling-governance` shard by updating the documentation to reflect reality.
7+
- Aligned with the Builder style and Librarian persona, which focuses on factual doc quality and executable examples.
8+
- Trade-offs:
9+
- Structure: Minimal impact.
10+
- Velocity: Immediate fix.
11+
- Governance: Ensures CLI help text is consistently represented in the docs.
12+
13+
### Option B
14+
Manually patch the Markdown to add the missing tags and text.
15+
- Overkill when a tooling command already exists to do this programmatically and guarantee sync.
16+
- More prone to drift or formatting errors.
17+
- Slower velocity compared to the automated tool.
18+
19+
## Decision
20+
Proceed with **Option A**. The `docs/reference-cli.md` had drifted because it lacked `<!-- HELP: -->` blocks for several new commands (diff, context, check-ignore, tools, baseline, handoff). Adding these and running `cargo xtask docs --update` restores synchronization and fixes the factual drift.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"prompt_id": "librarian_docs_examples",
3+
"persona": "Librarian",
4+
"style": "Builder",
5+
"primary_shard": "tooling-governance",
6+
"allowed_paths": [
7+
"xtask/**",
8+
".github/workflows/**",
9+
"docs/**",
10+
"ROADMAP.md",
11+
"CHANGELOG.md",
12+
"Cargo.toml",
13+
"Cargo.lock"
14+
],
15+
"gate_profile": "docs-executable",
16+
"allowed_outcomes": [
17+
"pr_ready_patch",
18+
"learning_pr"
19+
]
20+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## 💡 Summary
2+
Added missing CLI help markers to `docs/reference-cli.md` and synced the document using `cargo xtask docs --update`. This fixes factual drift between the reference documentation and the actual CLI implementation.
3+
4+
## 🎯 Why
5+
The `docs/reference-cli.md` file was missing `<!-- HELP: <command> -->` tags for several commands: `diff`, `context`, `check-ignore`, `tools`, `baseline`, `handoff`. Because the tags were missing, `cargo xtask docs --check` failed and the documentation was outdated, which violates the `docs-executable` gate profile requiring docs and schemas to match CLI behavior.
6+
7+
## 🔎 Evidence
8+
The `cargo xtask docs --check` command failed initially:
9+
```text
10+
Error: Documentation drift detected in /app/docs/reference-cli.md. Run `cargo xtask docs --update` to fix.
11+
```
12+
13+
## 🧭 Options considered
14+
### Option A (recommended)
15+
- Programmatically add the missing `<!-- HELP: <cmd> -->` tags and run `cargo xtask docs --update`.
16+
- Fits this repo and shard by ensuring documentation syncs mechanically with code.
17+
- Trade-offs: Structure is minimal, Velocity is high, Governance is enforced via automated tooling.
18+
19+
### Option B
20+
- Manually write out the help text into the markdown document.
21+
- Slower, error-prone, and likely to drift again immediately.
22+
- Trade-offs: Negative velocity and poor governance.
23+
24+
## ✅ Decision
25+
Chose Option A. By placing the correct marker pairs and regenerating the file, the workspace tool automatically injects the latest text and passes the `--check` gate.
26+
27+
## 🧱 Changes made (SRP)
28+
- `docs/reference-cli.md`
29+
30+
## 🧪 Verification receipts
31+
```text
32+
$ cargo xtask docs --check
33+
Error: Documentation drift detected in /app/docs/reference-cli.md. Run `cargo xtask docs --update` to fix.
34+
35+
$ cargo xtask docs --update
36+
Updated /app/docs/reference-cli.md
37+
38+
$ cargo xtask docs --check
39+
Documentation is up to date.
40+
41+
$ cargo fmt -- --check
42+
$ cargo clippy -- -D warnings
43+
```
44+
45+
## 🧭 Telemetry
46+
- Change shape: Docs update
47+
- Blast radius: `docs/reference-cli.md` only. No API, IO, or schema impact.
48+
- Risk class: Low + why: Only touches markdown text documentation via established xtask mechanisms.
49+
- Rollback: Revert markdown changes.
50+
- Gates run: `cargo xtask docs --check`, `cargo fmt -- --check`, `cargo clippy`
51+
52+
## 🗂️ .jules artifacts
53+
- `.jules/runs/c346971f-d18f-42fe-b66b-eed1583c8dc0/envelope.json`
54+
- `.jules/runs/c346971f-d18f-42fe-b66b-eed1583c8dc0/decision.md`
55+
- `.jules/runs/c346971f-d18f-42fe-b66b-eed1583c8dc0/receipts.jsonl`
56+
- `.jules/runs/c346971f-d18f-42fe-b66b-eed1583c8dc0/result.json`
57+
- `.jules/runs/c346971f-d18f-42fe-b66b-eed1583c8dc0/pr_body.md`
58+
59+
## 🔜 Follow-ups
60+
None.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{"command": "cargo xtask docs --check", "status": "failed", "output_fragment": "Error: Documentation drift detected in /app/docs/reference-cli.md"}
2+
{"command": "cargo xtask docs --update", "status": "success", "output_fragment": "Updated /app/docs/reference-cli.md"}
3+
{"command": "cargo xtask docs --check", "status": "success", "output_fragment": "Documentation is up to date."}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"outcome": "success",
3+
"files_changed": [
4+
"docs/reference-cli.md"
5+
]
6+
}

0 commit comments

Comments
 (0)