Skip to content

Commit 33e5c14

Browse files
docs(8a5b-e07b): update CLAUDE.md and ticket CLI reference for archived exclusion (merge worktree-20260327-174646)
2 parents efb3a9c + 3a28be1 commit 33e5c14

19 files changed

+2737
-257
lines changed

.test-index

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ plugins/dso/scripts/issue-quality-check.sh:tests/scripts/test_issue_quality_chec
6060
plugins/dso/scripts/pre-commit-format-fix.sh:tests/scripts/test-precommit-format-fix-config-paths.sh
6161
plugins/dso/scripts/project-detect.sh:tests/scripts/test-ci-generator-integration.sh,tests/scripts/test-project-detect.sh
6262
plugins/dso/scripts/ticket-bridge-status.sh:tests/scripts/test_bridge_status.py
63+
plugins/dso/scripts/ticket-graph.py:tests/scripts/test_ticket_graph.py
6364
plugins/dso/scripts/ticket-lib.sh:tests/scripts/test_revert_event.py,tests/scripts/test-ticket-lib.sh,tests/scripts/test-ticket-health-guards.sh
6465
plugins/dso/scripts/ticket-list.sh:tests/scripts/test-ticket-list.sh,tests/scripts/test_bridge_alert_display.py
6566
plugins/dso/scripts/ticket-revert.sh:tests/scripts/test_revert_event.py
@@ -71,6 +72,7 @@ plugins/dso/scripts/agent-profiles/prompts/explore-structured-output.md:tests/sc
7172
plugins/dso/scripts/runners/bash-runner.sh:tests/scripts/test-test-batched.sh
7273
plugins/dso/scripts/capture-review-diff.sh:tests/hooks/test-merge-aware-diff.sh
7374
plugins/dso/scripts/agent-batch-lifecycle.sh:tests/scripts/test-validate-phase-v2-removal.sh
75+
plugins/dso/scripts/validate-issues.sh:tests/scripts/test-validate-issues-timestamp.sh
7476
plugins/dso/scripts/validate-phase.sh:tests/test-validate-phase-portability.sh,tests/scripts/test-validate-phase-v2-removal.sh
7577
plugins/dso/scripts/validate.sh:tests/plugin/test-validate-work-portability.sh,tests/hooks/test-validate-review-output.sh,tests/hooks/test-validate-crash-detection.sh,tests/scripts/test-validate-test-batched-integration.sh,tests/scripts/test-validate-flock-timeout.sh,tests/scripts/test-validate-background.sh,tests/scripts/test-validate-skip-ci-flag.sh,tests/scripts/test-validate-issues.sh,tests/scripts/test-validate-config.sh,tests/scripts/test-validate-script-writes-integration.sh,tests/scripts/test-validate-config-driven.sh,tests/scripts/test-validate-state-lifecycle.sh,tests/test-validate-phase-portability.sh,tests/scripts/test-validate-comment-accuracy.sh,tests/scripts/test-validate-e2e-missing-target.sh
7678
plugins/dso/scripts/worktree-cleanup.sh:tests/scripts/test_worktree_cleanup_startup_config.py
@@ -186,3 +188,5 @@ plugins/dso/skills/architect-foundation/SKILL.md:tests/hooks/test-sub-agent-guar
186188
plugins/dso/agents/red-test-writer.md: tests/agents/test-red-test-writer.sh
187189
plugins/dso/agents/red-test-evaluator.md: tests/agents/test-red-test-evaluator.sh
188190
tests/lib/markdown_helpers.py:tests/docs/test_extract_section_deduplication.py
191+
plugins/dso/scripts/ticket-unblock.py: tests/scripts/test_ticket_unblock.py
192+
plugins/dso/scripts/ticket-benchmark.sh: tests/scripts/test-ticket-benchmark.sh

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Priority: 0-4 (0=critical, 4=backlog). Never use "high"/"medium"/"low".
5454

5555
## Architecture
5656

57-
**Ticket system v3 (event-sourced)**: Orphan git branch `tickets` mounted at `.tickets-tracker/`. JSON event files per ticket; Python reducer (`ticket-reducer.py`) compiles state on-demand. Writes are serialized with `fcntl.flock` to prevent concurrent corruption. CLI: `plugins/dso/scripts/ticket <subcommand>` (full reference: `plugins/dso/docs/ticket-cli-reference.md`). **Jira bridge**: `.claude/scripts/dso ticket sync` (incremental default, `--full` to force, `--check` for dry-run). Requires `JIRA_URL`, `JIRA_USER`, `JIRA_API_TOKEN`.
57+
**Ticket system v3 (event-sourced)**: Orphan git branch `tickets` mounted at `.tickets-tracker/`. JSON event files per ticket; Python reducer (`ticket-reducer.py`) compiles state on-demand. Writes are serialized with `fcntl.flock` to prevent concurrent corruption. CLI: `plugins/dso/scripts/ticket <subcommand>` (full reference: `plugins/dso/docs/ticket-cli-reference.md`). **Archived-ticket exclusion**: All scan operations (`ticket list`, `ticket deps`, `ticket-graph.py` dep lookups) exclude archived tickets by default; `ticket show` always includes them. `ticket list` and `ticket deps` accept `--include-archived` to override. `ticket transition close` uses a single `batch_close_operations` scan (no repeated reducer calls). `ticket-graph.py` uses a single `reduce_all_tickets` call per invocation. **Jira bridge**: `.claude/scripts/dso ticket sync` (incremental default, `--full` to force, `--check` for dry-run). Requires `JIRA_URL`, `JIRA_USER`, `JIRA_API_TOKEN`.
5858
**Hook architecture**: Consolidated dispatchers (`pre-bash.sh` + `post-bash.sh`). All hooks are jq-free — use `parse_json_field`, `json_build`, and `python3` for JSON parsing. See `plugins/dso/hooks/dispatchers/` and `plugins/dso/hooks/lib/`. **Review gate (two-layer defense-in-depth)**: Layer 1 — `pre-commit-review-gate.sh` (git pre-commit hook); default-deny allowlist from `review-gate-allowlist.conf`; checks review-status + diff hash; formatting-only mismatches self-heal via `ruff format`. Layer 2 — `review-gate.sh` (PreToolUse hook, wraps `review-gate-bypass-sentinel.sh`); blocks `--no-verify`, `-n`, `core.hooksPath=` override, `git commit-tree`, direct `.git/hooks/` writes, direct writes/deletions to `test-gate-status` and `test-exemptions` (only `record-test-status.sh` and `record-test-exemption.sh` are authorized writers). **Test gate (two-layer defense-in-depth)**: Layer 1 — `pre-commit-test-gate.sh` (git pre-commit hook); verifies `test-gate-status` for each staged source file with an associated test (fuzzy matching or `.test-index`). Test dirs: `test_gate.test_dirs` in `.claude/dso-config.conf` (default: `tests/`). `.test-index` format: `source/path.ext: test/path1.ext, test/path2.ext` (one per line; `#` comments ok). **RED marker format**: `source/path.ext: test/path.ext [first_red_test_name]` — `[marker]` marks boundary between GREEN (passing) and RED (not yet implemented) tests; failures at or after marker are tolerated. RED tests must be at end of test file. **TDD workflow**: Add test at end of file + `[test_name]` marker to `.test-index` — e.g., `source/foo.sh: tests/test_foo.sh [test_new_feature]`. Remove marker after implementation passes. **Epic closure**: blocked while any `[marker]` entries remain in `.test-index`. Layer 2 — `review-gate-bypass-sentinel.sh` blocks direct writes/deletions to `test-gate-status` and `test-exemptions`.
5959
**Validation gate**: `validate.sh` writes state; hooks block sprint/epic if validation hasn't passed. `--verbose` for real-time progress.
6060
**Agent routing**: `discover-agents.sh` resolves routing categories to agents via `agent-routing.conf`; all fall back to `general-purpose`. See `plugins/dso/docs/INSTALL.md`. **Named-agent dispatch** (via `subagent_type`, defined in `plugins/dso/agents/`):

plugins/dso/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dso",
3-
"version": "0.34.0",
3+
"version": "0.35.0",
44
"description": "Workflow infrastructure plugin for Claude Code projects",
55
"commands": "./commands/",
66
"skills": "./skills/",

plugins/dso/docs/ticket-cli-reference.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,23 @@ $ .claude/scripts/dso ticket show --format=llm w21-a3f7
222222
List all tickets.
223223

224224
```
225-
.claude/scripts/dso ticket list [--format=llm]
225+
.claude/scripts/dso ticket list [--format=llm] [--include-archived]
226226
```
227227

228228
**Arguments:**
229229

230230
| Argument | Required | Description |
231231
|---|---|---|
232232
| `--format=llm` | No | JSONL output — one minified ticket per line (see Output Formats section) |
233+
| `--include-archived` | No | Include archived tickets in output (default: archived tickets are excluded) |
233234

234235
**Output:** Default: a JSON array of compiled ticket state objects. `--format=llm`: JSONL, one object per line.
235236

236237
**Behavior:**
237238

238239
- Runs the reducer on every ticket directory in `.tickets-tracker/`
239240
- Hidden directories (names starting with `.`) are skipped
241+
- Archived tickets are excluded by default; pass `--include-archived` to include them
240242
- Tickets that fail to reduce produce an error-state entry: `{"ticket_id": "...", "status": "error", "error": "reducer_failed"}`; these are included in the output array rather than causing an early exit
241243
- Aggregate unresolved bridge alert count is emitted to stderr if non-zero
242244

@@ -437,7 +439,7 @@ $ .claude/scripts/dso ticket unlink w21-a3f7 w21-b9c2
437439
Show the dependency graph for a ticket.
438440

439441
```
440-
.claude/scripts/dso ticket deps <ticket_id> [--tickets-dir=<path>]
442+
.claude/scripts/dso ticket deps <ticket_id> [--tickets-dir=<path>] [--include-archived]
441443
```
442444

443445
**Arguments:**
@@ -446,6 +448,7 @@ Show the dependency graph for a ticket.
446448
|---|---|---|
447449
| `ticket_id` | Yes | The ticket whose dependency graph to show |
448450
| `--tickets-dir=<path>` | No | Override the tracker directory (defaults to `.tickets-tracker/`) |
451+
| `--include-archived` | No | Include archived tickets in the dep graph (default: archived tickets are excluded) |
449452

450453
**Output:** JSON object with the following fields:
451454

@@ -468,6 +471,8 @@ Show the dependency graph for a ticket.
468471

469472
**Behavior:**
470473

474+
- Archived tickets are excluded from the dep graph by default; pass `--include-archived` to include them
475+
- If the queried ticket itself is archived, the command exits with an error unless `--include-archived` is passed: `Error: ticket '<id>' is archived. Use --include-archived to include archived tickets.`
471476
- Uses a graph cache keyed by content hash of all ticket directories to avoid redundant reducer calls on repeated queries
472477
- Tombstone-aware: archived/tombstoned tickets count as closed for `ready_to_work` computation
473478
- Blockers include: tickets with a `depends_on` relation stored in this ticket's directory, and tickets with a `blocks` relation targeting this ticket stored in their own directory
@@ -477,13 +482,16 @@ Show the dependency graph for a ticket.
477482
| Code | Meaning |
478483
|---|---|
479484
| `0` | JSON dep graph printed to stdout |
480-
| `1` | Ticket not found |
485+
| `1` | Ticket not found or ticket is archived (without `--include-archived`) |
481486

482487
**Example:**
483488

484489
```
485490
$ .claude/scripts/dso ticket deps w21-a3f7
486491
{"ticket_id":"w21-a3f7","deps":[{"target_id":"w21-b9c2","relation":"blocks"}],"blockers":[],"ready_to_work":true}
492+
493+
$ .claude/scripts/dso ticket deps w21-a3f7 --include-archived
494+
{"ticket_id":"w21-a3f7","deps":[{"target_id":"w21-b9c2","relation":"blocks"}],"blockers":[],"ready_to_work":true}
487495
```
488496

489497
---
@@ -706,6 +714,55 @@ $ .claude/scripts/dso ticket bridge-fsck --tickets-tracker=/path/to/tracker
706714

707715
---
708716

717+
### `ticket-benchmark.sh`
718+
719+
Benchmark the ticket list or close command against a seeded ticket system.
720+
721+
```
722+
plugins/dso/scripts/ticket-benchmark.sh [-n <count>] [--threshold <seconds>] [--mode=list|close]
723+
```
724+
725+
**Arguments:**
726+
727+
| Argument | Required | Description |
728+
|---|---|---|
729+
| `-n <count>` | No | Number of tickets to seed (default: `300`; `0` = use existing repo tickets) |
730+
| `--threshold <seconds>` | No | Max acceptable wall-clock time in seconds. Defaults: `3s` for n≤300, `10s` for n≤1000, `30s` for n>1000 (list mode); `10s` (close mode) |
731+
| `--mode=list\|close` | No | Benchmark mode (default: `list`). `list` measures `ticket list` wall-clock time. `close` seeds a mixed population and measures `ticket transition open→closed`. |
732+
733+
**Behavior:**
734+
735+
- When run without `-n` (or with `-n 0`) inside a repo with an initialized ticket system, benchmarks the existing tickets
736+
- Otherwise creates a temporary git repo, seeds N tickets, and benchmarks that
737+
- `close` mode seeds a mix of open, in-progress, and archived tickets, then measures a single `ticket transition open→closed` including all `batch_close_operations` work
738+
739+
**Exit codes:**
740+
741+
| Code | Meaning |
742+
|---|---|
743+
| `0` | Elapsed time was below the threshold |
744+
| `1` | Elapsed time exceeded the threshold |
745+
| `2` | Invalid arguments |
746+
747+
**Output:**
748+
749+
```
750+
Elapsed: X.XXs for N tickets (list mode)
751+
Elapsed: X.XXs for closing ticket with N non-archived tickets in tracker (close mode)
752+
```
753+
754+
**Example:**
755+
756+
```
757+
$ plugins/dso/scripts/ticket-benchmark.sh --mode=list -n 300
758+
Elapsed: 1.23s for 300 tickets
759+
760+
$ plugins/dso/scripts/ticket-benchmark.sh --mode=close -n 100
761+
Elapsed: 0.87s for closing ticket with 100 non-archived tickets in tracker
762+
```
763+
764+
---
765+
709766
## Environment Variables
710767

711768
| Variable | Used by | Description |

0 commit comments

Comments
 (0)