Skip to content

fix(B-0140): port profile.sh to TS — Phase 2 (4 of 8)#1962

Merged
AceHack merged 1 commit into
mainfrom
chore/b0140-phase2-profile-ts-port
May 7, 2026
Merged

fix(B-0140): port profile.sh to TS — Phase 2 (4 of 8)#1962
AceHack merged 1 commit into
mainfrom
chore/b0140-phase2-profile-ts-port

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 7, 2026

Summary

  • Port tools/profile.sh to tools/profile.ts
  • Same commands: install/counters/trace/gcdump/bench/coverage
  • tsc clean, 4 of 8 remaining .sh-only files ported

Test plan

  • bun --bun tsc --noEmit — clean
  • bun tools/profile.ts --help — displays usage

🤖 Generated with Claude Code

Profiling helper: install/counters/trace/gcdump/bench/coverage.
tsc clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 7, 2026 22:45
@AceHack AceHack enabled auto-merge (squash) May 7, 2026 22:45
@AceHack AceHack merged commit b4de478 into main May 7, 2026
27 checks passed
@AceHack AceHack deleted the chore/b0140-phase2-profile-ts-port branch May 7, 2026 22:48
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.

Pull request overview

Ports the repo’s profiling helper from a Bash script to a Bun/TypeScript CLI under tools/, aiming to keep the same diagnostic workflows (install tools, counters, trace, gcdump, bench, coverage) while continuing the broader .sh.ts migration.

Changes:

  • Added tools/profile.ts implementing install, counters, trace, gcdump, bench, and coverage commands via spawnSync.
  • Removed the legacy tools/profile.sh.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
tools/profile.ts New Bun/TS implementation of the profiling helper commands (dotnet diagnostics, benchmarks, coverage).
tools/profile.sh Deleted legacy Bash implementation now replaced by the TS tool.

Comment thread tools/profile.ts
return resolve(dirname(fileURLToPath(import.meta.url)), "..");
}

function run(cmd: string, args: string[], cwd?: string): void {
Comment thread tools/profile.ts
Comment on lines +25 to +31
for (const tool of tools) {
const update = spawnSync("dotnet", ["tool", "update", "--global", tool], {
stdio: "inherit",
});
if (update.status !== 0) {
run("dotnet", ["tool", "install", "--global", tool]);
}
Comment thread tools/profile.ts
"/p:CollectCoverage=true",
"/p:CoverletOutputFormat=cobertura",
"/p:CoverletOutput=./TestResults/",
'/p:Exclude=[Dbsp.Tests.*]*',
Comment thread tools/profile.ts
bun tools/profile.ts trace <pid> # session trace for speedscope.app
bun tools/profile.ts gcdump <pid> # heap dump for PerfView
bun tools/profile.ts bench [filter] # BenchmarkDotNet run with memory diagnoser
bun tools/profile.ts coverage # run tests with coverage, emit HTML
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