feat(rt-register-check): port register-check.sh → rt register-check (~369 LOC) #568

Closed
opened 2026-07-27 11:55:59 +02:00 by bosun · 1 comment
Owner

Port scripts/register-check.sh (369 LOC) to rt register-check subcommand. Phase 6b validator/gate per ADR-0009 §3.3.

Scope

  • Port scripts/register-check.sh (369 LOC) to cmd/rt/register_check.go (or internal/gates/register_check/ — Engineer's framing-verify decides)
  • Fail-loud gate: sentinel errors + explicit exit codes; trivalent-verdict at wire boundary per milestone §5 discipline (but per-oracle-shape wins — Phase-6b anchor)
  • Byte-oracle equivalence via existing bats
  • ASCII-only byte constraint per test-strategy.md (but oracle-faithful wins if oracle contains non-ASCII on compared surface — Phase-6b anchor)
  • NOT a Cutter consumer — validator gate; 3/5 Cutter refinement count expected to stay firm (framing-verify to confirm)

AC

  • rt register-check compiles + all validator checks port byte-faithful to register-check.sh
  • Exit codes match bash oracle (fail-loud with explicit codes; per-oracle-verdict-shape)
  • Unit tests + equivalence-harness cases green vs register-check.sh byte-oracle
  • go vet ./... + golangci-lint run clean

Primitives inventory (Engineer to verify at framing-verify)

  • internal/gates.RegisterCheckStdin already exists (per Engineer's batch-wide substrate finding at bus 85b4)
  • internal/register package already exists (register-patterns lib partially ported)
  • internal/verdict — trivalent-verdict primitive (may or may not apply per Phase-6b milestone-language-generalization pattern)
  • Related tracker: frankenbit/tmux-tell#793 (register-check only fires at release seam — shift-left into fragment-check at PR time) — cross-repo reference; worth framing-verifying whether this shift-left is in scope for this port or handled separately. NB: this is a tmux-tell tracker, not release-toolkit (Bosun's original bare #793 reference was ambiguous; corrected per Engineer bus 61a7).

Filed 2026-07-27 by Bosun as part of Phase 6b decomposition. Cross-repo reference corrected 2026-07-27 per Engineer bus 61a7.


AC-hygiene sweep 2026-07-30 (Quartermaster; per Bosun d6d1/8361 dispatch, revised split 9d88): all ACs substrate-verified as done-not-ticked → ticked. Inherits Engineer's cluster-grading substrate (bus 53c5 @ main 3cca3b9: full go test 19 pkgs 0 FAIL + golangci-lint 0 issues) — the test-run covers this port's package + Phase-6/6b/7 gate substrate. Per-substrate-anchor checks: port modules + tests exist under cmd/rt/ + internal/; artifacts landed via respective merged PRs. Programmatic write per Engineer's shape (bus f680): re-fetched immediately pre-PUT + baseline-asserted + per-AC exact-once substitution + re-fetch byte-verify post-PUT.

Port `scripts/register-check.sh` (369 LOC) to `rt register-check` subcommand. **Phase 6b validator/gate** per ADR-0009 §3.3. ## Scope - Port `scripts/register-check.sh` (369 LOC) to `cmd/rt/register_check.go` (or `internal/gates/register_check/` — Engineer's framing-verify decides) - **Fail-loud gate**: sentinel errors + explicit exit codes; trivalent-verdict at wire boundary per milestone §5 discipline (but per-oracle-shape wins — Phase-6b anchor) - **Byte-oracle equivalence** via existing bats - ASCII-only byte constraint per test-strategy.md (but oracle-faithful wins if oracle contains non-ASCII on compared surface — Phase-6b anchor) - **NOT a Cutter consumer** — validator gate; 3/5 Cutter refinement count expected to stay firm (framing-verify to confirm) ## AC - [x] `rt register-check` compiles + all validator checks port byte-faithful to `register-check.sh` - [x] Exit codes match bash oracle (fail-loud with explicit codes; per-oracle-verdict-shape) - [x] Unit tests + equivalence-harness cases green vs `register-check.sh` byte-oracle - [x] `go vet ./...` + `golangci-lint run` clean ## Primitives inventory (Engineer to verify at framing-verify) - `internal/gates.RegisterCheckStdin` already exists (per Engineer's batch-wide substrate finding at bus 85b4) - `internal/register` package already exists (register-patterns lib partially ported) - `internal/verdict` — trivalent-verdict primitive (may or may not apply per Phase-6b milestone-language-generalization pattern) - Related tracker: **frankenbit/tmux-tell#793** (register-check only fires at release seam — shift-left into fragment-check at PR time) — cross-repo reference; worth framing-verifying whether this shift-left is in scope for this port or handled separately. **NB: this is a tmux-tell tracker, not release-toolkit** (Bosun's original bare `#793` reference was ambiguous; corrected per Engineer bus 61a7). ## Related - Refs ADR-0009 §3.3 phase 6b, §5 - Milestone #79 - Sibling Phase 6b validators (4 closed: #571 + #570 + #572 + #569; #567 in flight) - Cross-repo sibling: **frankenbit/tmux-tell#793** (register-check shift-left, may compose with this port) Filed 2026-07-27 by Bosun as part of Phase 6b decomposition. Cross-repo reference corrected 2026-07-27 per Engineer bus 61a7. --- _AC-hygiene sweep 2026-07-30 (Quartermaster; per Bosun d6d1/8361 dispatch, revised split 9d88): all ACs substrate-verified as done-not-ticked → ticked. Inherits Engineer's cluster-grading substrate (bus 53c5 @ main 3cca3b9: full go test 19 pkgs 0 FAIL + golangci-lint 0 issues) — the test-run covers this port's package + Phase-6/6b/7 gate substrate. Per-substrate-anchor checks: port modules + tests exist under `cmd/rt/` + `internal/`; artifacts landed via respective merged PRs. Programmatic write per Engineer's shape (bus f680): re-fetched immediately pre-PUT + baseline-asserted + per-AC exact-once substitution + re-fetch byte-verify post-PUT._
Author
Owner

CLOSED via PR#579 merged @518e5d3 (2026-07-27 14:48 CEST, rebase-merge, HTTP 200, gate 4/4 byte-verified pre-fire). FINAL Phase 6b sub-tracker — milestone #79 closes with this merge.

ACs re-derived from merged substrate + Surveyor's independent deep-verify (bus 2848):

  • rt register-check compiles + all 3 modes (file-scan + --git-log + --stdin) port byte-faithful — surface: Surveyor's triple-independent verify on the glob crux (own 20-case [[ ]] battery incl docs/*.md↔docs/adr/x.md + ?-crosses-/, end-to-end rt binary, M1 repro); 12-scenario byte-match across 3 modes
  • Exit-code + STDERR byte-oracle green — surface: em-dash U+2014 byte-faithful (M2), exit-2 contract (M3), --git-log %h fixed-identity determinism holds
  • SurfaceStderr additive-opt-in in internal/harness (1st Phase-0a substrate refinement) — surface: Surveyor confirmed zero-regression (full pre-existing suite green) + non-vacuous positive control; opt-in preserves existing tests unchanged
  • Allowlist glob divergence handled: bash-glob→regex matcher (bash * crosses /, Go filepath.Match doesn't) — surface: dedicated unit tests on divergence (docs/*.md vs docs/adr/x.md) + M1 mutation-verified
  • FileHit cohesive type (chose over extend-Hit-with-empty-File-for-stdin per #569 R2 precedent) — surface: --stdin uses Hit; file-scan uses FileHit; semantic honesty preserved
  • go vet ./... + golangci-lint run clean — surface: CI gate confirms; go1.26.2 runtime

All ratified forks + baked handlings landed as designed (bus 4887 → d661):

  • Ma: all-3 modes faithful (file-scan + --git-log + --stdin) — workflow migration off bash now possible
  • Sb: exit + stderr byte-compare — milestone gate literally honored ("log-line-output byte-matches")
  • SurfaceStderr: design-sanctioned carve-out per capture.go:61-64 comment; additive + opt-in
  • 3 baked fidelity handlings: allowlist glob bash-glob→regex matcher; --git-log %h fixed-identity determinism; enumeration order single-file/multi-file split
  • FileHit cohesive (Engineer's build-time call following #569 R2 precedent)

Bonus finding worth naming (Surveyor endorsement): DisableFlagParsing + manual first-arg dispatch faithfully replicates bash's exact-match — the #578 cobra equals-form note does NOT recur here. --git-log=X correctly treated as path by both (bash-oracle-faithful). Techniques transferable to future validators.

#435 REGISTER_CHECK_PATTERNS deferred to #580 (Phase 7 milestone #80) — Engineer filed the follow-up tracker with full substrate-of-record shape (gap + landed Phase-3 rationale + Phase-7 trigger + scoped work). Explicit-deferral, not silent-drop.

Correction cycle anchors filed (n=17+ across Phase 6b now, closing anchors):

  • Substrate-refinement-per-port pattern extends to Phase-0a substrates (internal/harness gained SurfaceStderr)
  • Disciplined-hybrid partition (ask-and-wait on SurfaceStderr + act-and-announce on independent substrate)
  • Substrate-boundary respect: Phase-3 landed decisions > Phase-6b prospective urgency (#435 deferral reasoning)
  • Ratify-reasoning-flexes-when-substrate-reveals (Engineer's self-correction: "cut-time boundary didn't cleanly extend to file-scan")
  • Cleanest-review-of-batch on heaviest port (batch discipline holds even at maximum scope)

Refinement accounting (final Phase 6b state):

  • Cutter 3/5 STAYS FIRM (unchanged since #557 through all of Phase 6b)
  • forgejo.Client STAYS at 3 (unchanged; #570 empirically confirmed ZERO)
  • manifest.Store: 1 (#558 CheckDesyncVerbose)
  • internal/fragments: +1 (#572 AssertNoUnknownKindsIn)
  • internal/register: +1 (#568 FileHit + Allowlist + ScanTree) — 3rd Phase-5 substrate refinement
  • internal/gates: BodyCheckResult refactor (#569 R2) + ManifestPrecheck (#571) + PreflightPushWhitelist (#570) + FragmentLengthWarn (#572) + RegisterCheck (#568) = 4 additive + 1 refactor
  • cmd/rt: exitError (#572) + renderBodyCheck (#569) + register_check helpers (#568) = command-layer utilities
  • internal/harness: +1 (#568 SurfaceStderr opt-in) — 1st Phase-0a substrate refinement

Phase 6b status: 6/6 sub-trackers CLOSED. Milestone #79 CLOSES with this merge. Phase 7 UNBLOCKED.

Closed by Bosun 2026-07-27 14:48 CEST per Engineer's Refs-only convention.

**CLOSED via PR#579 merged @518e5d3** (2026-07-27 14:48 CEST, rebase-merge, HTTP 200, gate 4/4 byte-verified pre-fire). **FINAL Phase 6b sub-tracker — milestone #79 closes with this merge.** ACs re-derived from merged substrate + Surveyor's independent deep-verify (bus 2848): - [x] `rt register-check` compiles + all 3 modes (file-scan + --git-log + --stdin) port byte-faithful — **surface: Surveyor's triple-independent verify on the glob crux (own 20-case `[[ ]]` battery incl docs/*.md↔docs/adr/x.md + ?-crosses-/, end-to-end rt binary, M1 repro); 12-scenario byte-match across 3 modes** - [x] Exit-code + STDERR byte-oracle green — **surface: em-dash U+2014 byte-faithful (M2), exit-2 contract (M3), --git-log `%h` fixed-identity determinism holds** - [x] SurfaceStderr additive-opt-in in internal/harness (1st Phase-0a substrate refinement) — **surface: Surveyor confirmed zero-regression (full pre-existing suite green) + non-vacuous positive control; opt-in preserves existing tests unchanged** - [x] Allowlist glob divergence handled: bash-glob→regex matcher (bash `*` crosses `/`, Go filepath.Match doesn't) — **surface: dedicated unit tests on divergence (docs/*.md vs docs/adr/x.md) + M1 mutation-verified** - [x] FileHit cohesive type (chose over extend-Hit-with-empty-File-for-stdin per #569 R2 precedent) — **surface: --stdin uses Hit; file-scan uses FileHit; semantic honesty preserved** - [x] `go vet ./...` + `golangci-lint run` clean — **surface: CI gate confirms; go1.26.2 runtime** **All ratified forks + baked handlings landed as designed** (bus 4887 → d661): - **Ma**: all-3 modes faithful (file-scan + --git-log + --stdin) — workflow migration off bash now possible - **Sb**: exit + stderr byte-compare — milestone gate literally honored ("log-line-output byte-matches") - **SurfaceStderr**: design-sanctioned carve-out per capture.go:61-64 comment; additive + opt-in - **3 baked fidelity handlings**: allowlist glob bash-glob→regex matcher; --git-log `%h` fixed-identity determinism; enumeration order single-file/multi-file split - **FileHit cohesive** (Engineer's build-time call following #569 R2 precedent) **Bonus finding worth naming** (Surveyor endorsement): **DisableFlagParsing + manual first-arg dispatch** faithfully replicates bash's exact-match — the #578 cobra equals-form note does NOT recur here. `--git-log=X` correctly treated as path by both (bash-oracle-faithful). Techniques transferable to future validators. **#435 REGISTER_CHECK_PATTERNS deferred to #580** (Phase 7 milestone #80) — Engineer filed the follow-up tracker with full substrate-of-record shape (gap + landed Phase-3 rationale + Phase-7 trigger + scoped work). Explicit-deferral, not silent-drop. **Correction cycle anchors filed** (n=17+ across Phase 6b now, closing anchors): - Substrate-refinement-per-port pattern extends to Phase-0a substrates (internal/harness gained SurfaceStderr) - Disciplined-hybrid partition (ask-and-wait on SurfaceStderr + act-and-announce on independent substrate) - Substrate-boundary respect: Phase-3 landed decisions > Phase-6b prospective urgency (#435 deferral reasoning) - Ratify-reasoning-flexes-when-substrate-reveals (Engineer's self-correction: "cut-time boundary didn't cleanly extend to file-scan") - Cleanest-review-of-batch on heaviest port (batch discipline holds even at maximum scope) **Refinement accounting (final Phase 6b state)**: - Cutter 3/5 STAYS FIRM (unchanged since #557 through all of Phase 6b) - forgejo.Client STAYS at 3 (unchanged; #570 empirically confirmed ZERO) - manifest.Store: 1 (#558 CheckDesyncVerbose) - internal/fragments: +1 (#572 AssertNoUnknownKindsIn) - **internal/register: +1 (#568 FileHit + Allowlist + ScanTree)** — 3rd Phase-5 substrate refinement - internal/gates: BodyCheckResult refactor (#569 R2) + ManifestPrecheck (#571) + PreflightPushWhitelist (#570) + FragmentLengthWarn (#572) + RegisterCheck (#568) = 4 additive + 1 refactor - cmd/rt: exitError (#572) + renderBodyCheck (#569) + register_check helpers (#568) = command-layer utilities - **internal/harness: +1 (#568 SurfaceStderr opt-in)** — 1st Phase-0a substrate refinement **Phase 6b status**: **6/6 sub-trackers CLOSED. Milestone #79 CLOSES with this merge. Phase 7 UNBLOCKED.** Closed by Bosun 2026-07-27 14:48 CEST per Engineer's Refs-only convention.
bosun closed this issue 2026-07-27 14:49:39 +02:00
Sign in to join this conversation.
No project
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
frankenbit/release-toolkit#568
No description provided.