Skip to content

Enforce evidence rules in validate; fix the 0.1.0 review findings - #1

Merged
Kadreev merged 2 commits into
mainfrom
fix/review-findings
Oct 4, 2026
Merged

Kadreev merged 2 commits into
mainfrom
fix/review-findings

Conversation

@Kadreev

@Kadreev Kadreev commented Oct 4, 2026

Copy link
Copy Markdown
Owner

What changed

Fixes from a code review of 0.1.0, in two commits.

1. Enforce the evidence rules in validate, not just in the CLI (64956b5)

  • The README says validate enforces "no run, no level bump", but a hand-edited current_level used to pass. validate now replays runs.yaml in file order from L0. Each level_changes entry must start where the earlier runs left the feature, and current_level must equal where the replay ends.
  • verified-fixed can only come from a run. set <issue> status verified-fixed and the dashboard menu refuse it, and validate rejects a verified-fixed issue that no run lists in issues_verified.
  • add-run rejects a level change that doesn't start at the feature's current level, and a backdated run no longer overwrites a newer last_validated.
  • set <f> reverify accepts only true/false/1/0. Before, yes was silently stored as false.
  • validate reports a bare - list entry, or surfaces:/children: that isn't a list, instead of crashing.

2. Remaining review findings (7d02cb1)

  • Tracker files are written via a temp file and a rename, so a crash or a sync client (OneDrive, Dropbox) never sees a half-written file.
  • The dashboard server answers a malformed edit body (bad JSON, null, an array) with 400 instead of 500.
  • A row's weight buttons are disabled while a save is in flight, so a double-click no longer sends the same value twice.
  • A value flag with no value (serve --port) is an error. Before, --port alone meant port 1.
  • init --root is now written to the config; before, it was ignored.
  • A stale SURFACES.md is removed once the last surfaces file is gone.
  • DIM_ICON, SEV_ORDER and cell move to src/format.mjs, and RUN_REF moves to schema.mjs (still re-exported from validate.mjs).

Why

The evidence rules are the product. CONTRIBUTING.md says a change that lets a level rise without a run needs a very good reason, but the validator itself let that happen.

For reviewers

  • Behaviour change: a tracker whose YAML was hand-edited against the rules (a level with no run behind it, or verified-fixed with no run) now fails validate. The fix is to record the missing run. Because of this, the next release should be 0.2.0, not 0.1.1. package.json is unchanged; the version bump happens at release time, as CONTRIBUTING.md says.
  • Multi-file edits (add-issue writes issues.yaml and then features.yaml) are atomic per file, not as a whole.
  • Not fixed: a dashboard left open while the CLI changes a weight still shows the old value until it's reloaded.
  • Every change has a line under [Unreleased] in CHANGELOG.md. README.md and docs/SCHEMA.md describe the replay rule.

Testing

  • node --test: 60/60 pass. 12 tests are new (8 in the first commit, 4 in the second), and 2 validate tests were updated to give the levels they use a backing run.
  • qa-tracker validate --dir examples/demo passes, and the demo's STATUS.md/SURFACES.md re-render byte-identical.
  • Ran a scratch copy of the demo through the real CLI: a hand-edited L4, a stale "from" level, reverify yes, status verified-fixed and a bare - are each now rejected with a clear message.
  • Weight buttons and the status menu were checked in a browser against a scratch copy of the demo.

🤖 Generated with Claude Code

Kadreev and others added 2 commits October 4, 2026 17:28
The README promised that `validate` enforces "no run, no level bump", but a
hand-edited current_level passed. validate now replays runs.yaml from L0:
each level change must start where earlier runs left the feature, and
current_level must equal where the replay ends. verified-fixed likewise now
needs a run that lists the issue in issues_verified; `set … status
verified-fixed` and the dashboard menu refuse it.

Also from the 0.1.0 review:
- add-run rejects a level change whose "from" is not the current level
- a backdated run no longer overwrites a newer last_validated
- `set <f> reverify` rejects values other than true/false/1/0 (was: false)
- validate reports null/scalar list entries and non-list surfaces/children
  instead of throwing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…0 review

- store: write every tracker file via temp file + rename, so a crash or a
  sync client never sees a truncated file (multi-file edits are still
  sequential, not transactional)
- server: malformed JSON, null or array bodies are a 400, not a 500
- dashboard: hold a row's weight buttons while a save is in flight, so a
  double-click can't send the same value twice
- cli: a value flag with no value is an error (`serve --port` meant port 1)
- cli: `init --root` is written to the config, relative to the data dir
- store: drop a stale SURFACES.md once the last surfaces file is gone
- refactor: DIM_ICON/SEV_ORDER/cell move to src/format.mjs and RUN_REF to
  schema.mjs (still re-exported from validate.mjs); demo output unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kadreev
Kadreev merged commit a6669a1 into main Oct 4, 2026
6 checks passed
@Kadreev Kadreev mentioned this pull request Oct 4, 2026
@Kadreev
Kadreev deleted the fix/review-findings branch October 31, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant