Skip to content

feat(hygiene): migrate shard schema checker to Bun/TypeScript#1986

Closed
AceHack wants to merge 3 commits into
mainfrom
feat/b-0140-shard-schema-checker
Closed

feat(hygiene): migrate shard schema checker to Bun/TypeScript#1986
AceHack wants to merge 3 commits into
mainfrom
feat/b-0140-shard-schema-checker

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 8, 2026

Summary\nDecomposed from PR #1976 and #1977 to ensure atomic commits.\nThis is the pure code migration for B-0140 Phase 2, converting the check-tick-history-shard-schema.sh script to Bun/TypeScript.\n\n## Integrity\n- No documentation or shadow log changes are bundled here.\n- Script executes via Bun.

AceHack added 2 commits May 7, 2026 21:28
Decomposed from blob PRs #1976/#1977.
This is the B-0140 Phase 2 migration for the tick history shard schema validator.
Copilot AI review requested due to automatic review settings May 8, 2026 01:33
@AceHack AceHack enabled auto-merge (squash) May 8, 2026 01:34
Co-Authored-By: Codex <noreply@openai.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Comment on lines 21 to 27
Comment on lines 65 to 70
Comment on lines 95 to 110
Comment on lines 646 to 650
@AceHack
Copy link
Copy Markdown
Member Author

AceHack commented May 8, 2026

Superseded by #1976 after syncing this branch with current main. The TypeScript shard-schema checker content is already on main; this PR's remaining diff is only the executable-bit change on tools/hygiene/check-tick-history-shard-schema.ts, which is not needed for the documented bun tools/hygiene/check-tick-history-shard-schema.ts invocation. Closing to keep the PR queue clean.

@AceHack AceHack closed this May 8, 2026
auto-merge was automatically disabled May 8, 2026 01:38

Pull request was closed

AceHack added a commit that referenced this pull request May 17, 2026
… (9 tests)

Addresses B-0156 acceptance criterion 2 ("each TS sibling has at least
one bun test covering its primary entry path") for the Phase 2 schema
port at tools/hygiene/check-tick-history-shard-schema.ts. The .sh
original was deleted in PR #1986; the .ts had no co-located test.

What

- Export scanOne and ScanResult from check-tick-history-shard-schema.ts
  (minimal surface change — no behavior change).
- Add check-tick-history-shard-schema.test.ts with 9 cases:
  - 3 acceptance paths (HHMMZ.md, HHMMZ-<hex>.md, HH:MM:SSZ col1)
  - 6 violation paths (bad filename, col1 date/time mismatches,
    insufficient pipes, empty file, col1 format error)
- Dynamic-import pattern so REPO_ROOT is set to a tmpdir before module
  load, captures and restores the prior REPO_ROOT to keep env clean
  across the broader bun test run.

Why

Per the B-0156 row, criterion 2 was unverified for the 3 hygiene .ts
ports (snapshot-github-settings, check-github-settings-drift,
check-tick-history-shard-schema). The check-tick-history schema port
is the smallest of the three (~5KB) and has the most testable surface
(per-shard validator with structured return). This is the bounded
B-0156 slice for this tick.

Checks

- bun test tools/hygiene/check-tick-history-shard-schema.test.ts: 9/9 pass
- bun test tools/hygiene/: 181/181 pass (no regression)
- bun tools/hygiene/check-tick-history-shard-schema.ts: production
  CLI runs (existing pre-PR violations unchanged)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 17, 2026
… (9 tests) (#4047)

Addresses B-0156 acceptance criterion 2 ("each TS sibling has at least
one bun test covering its primary entry path") for the Phase 2 schema
port at tools/hygiene/check-tick-history-shard-schema.ts. The .sh
original was deleted in PR #1986; the .ts had no co-located test.

What

- Export scanOne and ScanResult from check-tick-history-shard-schema.ts
  (minimal surface change — no behavior change).
- Add check-tick-history-shard-schema.test.ts with 9 cases:
  - 3 acceptance paths (HHMMZ.md, HHMMZ-<hex>.md, HH:MM:SSZ col1)
  - 6 violation paths (bad filename, col1 date/time mismatches,
    insufficient pipes, empty file, col1 format error)
- Dynamic-import pattern so REPO_ROOT is set to a tmpdir before module
  load, captures and restores the prior REPO_ROOT to keep env clean
  across the broader bun test run.

Why

Per the B-0156 row, criterion 2 was unverified for the 3 hygiene .ts
ports (snapshot-github-settings, check-github-settings-drift,
check-tick-history-shard-schema). The check-tick-history schema port
is the smallest of the three (~5KB) and has the most testable surface
(per-shard validator with structured return). This is the bounded
B-0156 slice for this tick.

Checks

- bun test tools/hygiene/check-tick-history-shard-schema.test.ts: 9/9 pass
- bun test tools/hygiene/: 181/181 pass (no regression)
- bun tools/hygiene/check-tick-history-shard-schema.ts: production
  CLI runs (existing pre-PR violations unchanged)

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 17, 2026
… met (#4073)

The TypeScript-standardization row was in substrate-drift state: row
remained `status: open` while every named artifact had landed and every
acceptance bullet had a corresponding merged PR.

Per `.claude/rules/backlog-item-start-gate.md` step 0 (substrate-drift
discriminator added 2026-05-16), the substrate-honest move on an
implementation tick is to close the row, not author more work.

Evidence (every acceptance bullet → merged PR):

1. Six non-install `.sh` files ported then deleted via Phases 1-4
   (snapshot/check-drift/check-schema in #1986; profile in #1962;
   amara/ani via subsequent ports). Self-test `find tools -name '*.sh'
   …` now returns only install-graph files under `tools/setup/`.
2. Each TS sibling has a `bun test`: `tools/profile.test.ts` plus
   `tools/peer-call/smoke.test.ts` (all 8 peer-call wrappers).
3. Phase 5 sweep complete — `.sh` originals deleted (recoverable via
   `git log --diff-filter=D` per LOST-FILES-LOCATIONS.md).
4. Phase 6 `.py` policy lint: `lint-no-python-files` job at
   `.github/workflows/gate.yml:877` invoking `bun
   tools/lint/no-python-files.ts`. Allowlist + 9-test suite present.
5. `grep -E '\.(sh|py)' package.json` returns no matches.
6. All migration PRs landed green; no follow-up regression rows.

Smallest safe slice: status flip + Resolution section + BACKLOG.md
index regen via `BACKLOG_WRITE_FORCE=1 bun tools/backlog/generate-index.ts`.

operative-authorization: aaron 2026-05-14: "- **Devil-pole**
(edge-runner drive): keep pushing, discover, go hard, never-be-idle"

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants