feat(issues): scripts and schema for issue records and comments (phase 1, part 1) #8

Merged
neerdoc merged 192 commits from feat/phase-1-issue-scripts into main 2026-11-16 12:07:12 +00:00
Owner

Part 1 of Phase 1: scripts and schema for issue records and comments

Brings the wulf-dev issue scripts and schema in line with ADR-WULF-006 (issue
records) and ADR-WULF-007 (issue comments). Part 2 (migration of the flat
files in other repos) and part 3 (pr.sh roadmap check) are separate PRs.

Roadmap items P1-1 to P1-4 are ticked in their own commit.

Scripts and schema

  • issue-new.sh: allocates the number from the counter issues/.next, writes
    issues/open/NNNN--<slug>.yaml, updates the counter, never commits; rolls
    back when a write fails.
  • comment-new.sh (new): creates issues/comments/NNNN/<id>.md for an
    existing issue, text from arguments or standard input, never commits.
  • issue-validate.sh: walks every path under issues/ (state folders,
    names, numbers, counter, comment folders and files) and checks each issue
    file against the schema; [--] [ISSUES_DIR]; collected errors sorted in
    byte order; exit 2 for configuration errors.
  • lib.sh: the shared root rule (own repo, or the superproject of the
    submodule modules/wulf-dev, also when the consuming repo is itself a
    submodule), state table loader, escaping, counter and character checks, the
    no-root stop. A symlinked issues folder and unreadable paths have their own
    messages.
  • issue.schema.json (state folders, numbers up to 9999999, no status or
    closed), issue-states.json (state table, one place).
  • pr.sh and install-hooks.sh now source lib.sh: they stop with the
    no-root message outside a git repository and are immune to CDPATH.

Documents

  • ADR-WULF-006: issue text is printable ASCII, slug cut at 50 characters,
    seven-digit numbers, an issue file is never deleted; ADR-WULF-007 (issue
    comments, new); ADR-WULF-008 (standards for code, tests and the design
    document: no repetition, functional tests, one test per case, no
    combination tests, one place for a fact).
  • Design docs/design/issue-scripts.md (DE-1 to DE-15, 727 lines); README rows
    and root paragraph; company/AGENTS.md "Issues" bullets and the rule that
    code, tests and design follow ADR-WULF-008.

Tests

  • 936 bats tests (tests/, test.sh; bats 1.11 or newer), each tied to a
    design element, one registered test per case. Acceptance criteria for the
    items verified by inspection in tests/acceptance-criteria.md.
  • Last run (bash 5.3 and bash 3.2.57): 936 tests, 933 passed, 0 failed, 3
    skipped (the rollback-that-fails-as-well branches, verified by inspection).

Issues, audits and review

  • Issues 0001 to 0005 migrated to the state-folder layout; 0006 to 0063 filed
    and triaged with the owner's notes as comment files. Closed: 0006 to 0047,
    0050, 0051. Not fixed on purpose: 0048 (wont-fix), 0049 and 0052 to 0063
    (deferred: other scripts, structure of tests, code and design, and two
    low-impact review findings).
  • Six audit rounds (reports/audit-issue-scripts.md, last round: no new
    issues). Review 001 by a different model: no High or Medium finding, three
    Low (one fixed, two deferred): docs/reviews/phase-1-issue-scripts/review-001.

Size

179 files, about 12,000 lines added: scripts 964 lines (the four issue
scripts), tests 4,362 lines plus 859 lines of helpers, design 727 lines, issue
records and comments 1,360, audit reports 3,002, review record 295.

Checks

  • bash test.sh: 936 tests, 0 failed, 3 skipped.
  • Not run: Linux, the hooks themselves, pr.sh against a real git system,
    sync-managed.sh.

🤖 Generated with Claude Code

## Part 1 of Phase 1: scripts and schema for issue records and comments Brings the wulf-dev issue scripts and schema in line with ADR-WULF-006 (issue records) and ADR-WULF-007 (issue comments). Part 2 (migration of the flat files in other repos) and part 3 (`pr.sh` roadmap check) are separate PRs. Roadmap items P1-1 to P1-4 are ticked in their own commit. ### Scripts and schema - `issue-new.sh`: allocates the number from the counter `issues/.next`, writes `issues/open/NNNN--<slug>.yaml`, updates the counter, never commits; rolls back when a write fails. - `comment-new.sh` (new): creates `issues/comments/NNNN/<id>.md` for an existing issue, text from arguments or standard input, never commits. - `issue-validate.sh`: walks every path under `issues/` (state folders, names, numbers, counter, comment folders and files) and checks each issue file against the schema; `[--] [ISSUES_DIR]`; collected errors sorted in byte order; exit 2 for configuration errors. - `lib.sh`: the shared root rule (own repo, or the superproject of the submodule `modules/wulf-dev`, also when the consuming repo is itself a submodule), state table loader, escaping, counter and character checks, the no-root stop. A symlinked issues folder and unreadable paths have their own messages. - `issue.schema.json` (state folders, numbers up to 9999999, no `status` or `closed`), `issue-states.json` (state table, one place). - `pr.sh` and `install-hooks.sh` now source `lib.sh`: they stop with the no-root message outside a git repository and are immune to `CDPATH`. ### Documents - ADR-WULF-006: issue text is printable ASCII, slug cut at 50 characters, seven-digit numbers, an issue file is never deleted; ADR-WULF-007 (issue comments, new); ADR-WULF-008 (standards for code, tests and the design document: no repetition, functional tests, one test per case, no combination tests, one place for a fact). - Design `docs/design/issue-scripts.md` (DE-1 to DE-15, 727 lines); README rows and root paragraph; `company/AGENTS.md` "Issues" bullets and the rule that code, tests and design follow ADR-WULF-008. ### Tests - 936 bats tests (`tests/`, `test.sh`; bats 1.11 or newer), each tied to a design element, one registered test per case. Acceptance criteria for the items verified by inspection in `tests/acceptance-criteria.md`. - Last run (bash 5.3 and bash 3.2.57): 936 tests, 933 passed, 0 failed, 3 skipped (the rollback-that-fails-as-well branches, verified by inspection). ### Issues, audits and review - Issues 0001 to 0005 migrated to the state-folder layout; 0006 to 0063 filed and triaged with the owner's notes as comment files. Closed: 0006 to 0047, 0050, 0051. Not fixed on purpose: 0048 (wont-fix), 0049 and 0052 to 0063 (deferred: other scripts, structure of tests, code and design, and two low-impact review findings). - Six audit rounds (`reports/audit-issue-scripts.md`, last round: no new issues). Review 001 by a different model: no High or Medium finding, three Low (one fixed, two deferred): `docs/reviews/phase-1-issue-scripts/review-001`. ### Size 179 files, about 12,000 lines added: scripts 964 lines (the four issue scripts), tests 4,362 lines plus 859 lines of helpers, design 727 lines, issue records and comments 1,360, audit reports 3,002, review record 295. ### Checks - `bash test.sh`: 936 tests, 0 failed, 3 skipped. - Not run: Linux, the hooks themselves, `pr.sh` against a real git system, `sync-managed.sh`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Replaces the cut at the last hyphen in ADR-WULF-006 with a plain cut at 50
characters; a hyphen left at the end stays.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The creation date is in the git history, like the closing date.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Drops status and closed; titles, labels, milestone and body are ASCII.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Applies the ADR-WULF-006 migration by hand: status open stays open; status,
closed and created removed; slugs derived from the titles. The arrow in 0005
is written as ->, because titles and bodies are ASCII only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Moves issues 0006 to 0013 from the audit into issues/open, adds the triage
notes, and files 0014 (git-dependent tests), 0015 (comments) and 0016 (the
comments ADR). The counter is now 0017.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replaces the unlimited number range with 0001 to 9999999 and states that an
issue file is never deleted; an unwanted issue moves to wont-fix or duplicate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
One Markdown file per comment under issues/comments/<number>/ with a random id;
author, date and order come from git; comments may be corrected in place.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The comments ADR it asked for is written and accepted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Applies ADR-WULF-007: each Triage section becomes a file under
issues/comments/<number>/. The current validator rejects the comments folder
until the comment checks are implemented.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolves 003 of review 001 of phase-1-issue-scripts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolves 001 of review 001 of phase-1-issue-scripts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolves 002 of review 001 of phase-1-issue-scripts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
WulfScience-FOSS/wulf-dev!8
No description provided.