Skip to content

fix(cli): speed up standalone version queries - #34

Merged
kunchenguid merged 3 commits into
mainfrom
fm/tasksaxi-version-fastpath-adopt-p4
Aug 7, 2026
Merged

kunchenguid merged 3 commits into
mainfrom
fm/tasksaxi-version-fastpath-adopt-p4

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Adopt the axi-sdk-js/fast-path in tasks-axi so tasks-axi --version hits the node floor (~31ms -> ~20ms), per the shared spec at /Users/kunchen/fm-homes/axi-a1/data/p4-fastpath-adoption-spec.md.

Required work:

  1. Bump the axi-sdk-js dependency range to include 0.1.10 (so the dependency-free axi-sdk-js/fast-path subpath export resolves) and install.
  2. tasks-axi computed its version inside src/cli.ts (a readPackageVersion() helper). Extract it into a LEAF src/version.ts that imports ONLY node builtins - never the heavy command graph - and re-import VERSION from it in cli.ts, so there is still one source of the version string.
  3. Rewrite bin/tasks-axi.ts to the exact benchmarked fast-path shape: import tryFastPath from axi-sdk-js/fast-path and VERSION from the leaf module; if tryFastPath(process.argv.slice(2), {version: VERSION}) returns false, await import("../src/cli.js") (dynamic, so the heavy graph loads only there) and await main().
  4. Keep the fast path conservative: exactly one argv element that is -v/-V/--version. Any other form (including a version flag in a trailing position such as list --version) falls through to runAxiCli, which remains the sole owner of the general case - list --version is still an unknown-flag validation error, exactly as before.

Hard constraints from the requester: firstmate's own backlog runs on tasks-axi, so --version output must stay byte-identical and NO command behavior may change - this is only the version fast path.

Regression-test approach mandated by the spec (deliberate decisions, not oversights):

  • A deterministic module-trace guard: an ESM loader hook (test/fixtures/module-trace-*.mjs) records every module URL the spawned bin process loads, and test/bin/version-fast-path.test.ts asserts src/cli.ts, axi-sdk-js/dist/index.js and @toon-format are absent on the --version path while the fast-path module and the leaf version module are present.
  • A NEGATIVE CONTROL proving the probe would catch a regression: --help, list --help and list --version must each still load the heavy graph.
  • Flag parity: -v, -V and --version each print exactly ${version}\n and exit 0, matching the pre-change output byte-for-byte.
  • DELIBERATELY NO wall-clock timing assertion in CI (neither absolute nor delta). A sibling task proved that flaky across CI runners (15ms and 30ms budgets both failed under contention). The module trace deterministically proves the heavy graph is skipped, which is the real mechanism of the speedup and the correct thing to assert. Do not add a timing gate.

The tests spawn the TypeScript bin via node --import tsx --import <register> bin/tasks-axi.ts rather than the built dist output, so the guard runs without requiring a prior build and exercises the sources under test.

AXI ergonomics must be preserved (per the axi skill). AGENTS.md gained a short 'Entry point & the --version fast path' section recording the leaf-module invariant and the no-timing-in-CI rule.

What Changed

  • Route standalone -v, -V, and --version requests through axi-sdk-js/fast-path, deferring the full CLI command graph for all other arguments.
  • Extract package-version resolution into a Node-only leaf module and update axi-sdk-js to ^0.1.10.
  • Add deterministic module-trace coverage for fast-path isolation, version-output parity, and full-CLI fallthrough behavior.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed
✅ **Rebase** - passed
✅ **Review** - completed
✅ **Test** - passed
✅ **Document** - passed
✅ **Lint** - passed
✅ **Push** - passed

Extract the package-version helper out of the heavy `src/cli.ts` graph into a
leaf `src/version.ts` (node builtins only), and rewrite `bin/tasks-axi.ts` to
answer a bare `-v`/`-V`/`--version` via `axi-sdk-js/fast-path`, dynamically
importing the command graph only for everything else. Bumps axi-sdk-js to
^0.1.10 for the `./fast-path` subpath export.

Version output is byte-identical and all other argv shapes still route through
`runAxiCli` unchanged. Guarded by a deterministic ESM loader module trace with
a negative control plus flag parity; no wall-clock assertion in CI.
@kunchenguid
kunchenguid merged commit 92911b2 into main Aug 7, 2026
5 checks passed
yjuyjuy added a commit to yjuyjuy/tasks-axi that referenced this pull request Aug 13, 2026
* fix(cli): speed up standalone version queries (kunchenguid#34)

* perf(cli): answer --version through the axi-sdk-js fast path

Extract the package-version helper out of the heavy `src/cli.ts` graph into a
leaf `src/version.ts` (node builtins only), and rewrite `bin/tasks-axi.ts` to
answer a bare `-v`/`-V`/`--version` via `axi-sdk-js/fast-path`, dynamically
importing the command graph only for everything else. Bumps axi-sdk-js to
^0.1.10 for the `./fast-path` subpath export.

Version output is byte-identical and all other argv shapes still route through
`runAxiCli` unchanged. Guarded by a deterministic ESM loader module trace with
a negative control plus flag parity; no wall-clock assertion in CI.

* no-mistakes(document): Confirm fast-path docs and lint cleanliness

* no-mistakes: apply CI fixes

* chore(main): release tasks-axi 0.2.5 (kunchenguid#35)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(cli): accept canonical Forgejo pull request URLs (kunchenguid#36)

* fix: accept canonical Forgejo pull request URLs as typed PR links

One classification seam (isPrUrl in src/pr-url.ts) now decides what
counts as a PR URL for prose link derivation, done/add --pr validation,
and public-followup pr_url deliverables: canonical GitHub
https://github.com/<owner>/<repo>/pull/<n> or Forgejo
https://<host>/<owner>/<repo>/pulls/<n> with a positive, no-leading-zero
number. Near misses (issue routes, singular/plural route confusion,
trailing slash, query/fragment, whitespace, userinfo, ports, encoded
separators, malformed segments) are rejected as --pr / pr_url values and
derive as doc links, never pr.

Fixes kunchenguid#19

* fix: validate pr links against the untrimmed input

Review follow-ups from pipeline run 01KZFA73D662DCSJ4HVWKW21QX: --pr values
and pr-kind addLinks are validated before any trim, so whitespace-padded
input is rejected instead of normalized. The literal NUL byte in
test/pr-url.test.ts is now written as a unicode source escape so git
treats the file as text; an embedded-space rejection case is added
alongside it.

* chore: remove committed no-mistakes evidence (now on orphan branch) (kunchenguid#39)

* chore: gitignore no-mistakes evidence dir (contributor safety) (kunchenguid#41)

---------

Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Evelyn Scidmore <13389701+escidmore@users.noreply.github.com>
Co-authored-by: Chris Yuan <cyuan@hyfin.app>
yjuyjuy added a commit to yjuyjuy/tasks-axi that referenced this pull request Aug 17, 2026
* fix(cli): speed up standalone version queries (kunchenguid#34)

* perf(cli): answer --version through the axi-sdk-js fast path

Extract the package-version helper out of the heavy `src/cli.ts` graph into a
leaf `src/version.ts` (node builtins only), and rewrite `bin/tasks-axi.ts` to
answer a bare `-v`/`-V`/`--version` via `axi-sdk-js/fast-path`, dynamically
importing the command graph only for everything else. Bumps axi-sdk-js to
^0.1.10 for the `./fast-path` subpath export.

Version output is byte-identical and all other argv shapes still route through
`runAxiCli` unchanged. Guarded by a deterministic ESM loader module trace with
a negative control plus flag parity; no wall-clock assertion in CI.

* no-mistakes(document): Confirm fast-path docs and lint cleanliness

* no-mistakes: apply CI fixes

* chore(main): release tasks-axi 0.2.5 (kunchenguid#35)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(cli): accept canonical Forgejo pull request URLs (kunchenguid#36)

* fix: accept canonical Forgejo pull request URLs as typed PR links

One classification seam (isPrUrl in src/pr-url.ts) now decides what
counts as a PR URL for prose link derivation, done/add --pr validation,
and public-followup pr_url deliverables: canonical GitHub
https://github.com/<owner>/<repo>/pull/<n> or Forgejo
https://<host>/<owner>/<repo>/pulls/<n> with a positive, no-leading-zero
number. Near misses (issue routes, singular/plural route confusion,
trailing slash, query/fragment, whitespace, userinfo, ports, encoded
separators, malformed segments) are rejected as --pr / pr_url values and
derive as doc links, never pr.

Fixes kunchenguid#19

* fix: validate pr links against the untrimmed input

Review follow-ups from pipeline run 01KZFA73D662DCSJ4HVWKW21QX: --pr values
and pr-kind addLinks are validated before any trim, so whitespace-padded
input is rejected instead of normalized. The literal NUL byte in
test/pr-url.test.ts is now written as a unicode source escape so git
treats the file as text; an embedded-space rejection case is added
alongside it.

* chore: remove committed no-mistakes evidence (now on orphan branch) (kunchenguid#39)

* chore: gitignore no-mistakes evidence dir (contributor safety) (kunchenguid#41)

---------

Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Evelyn Scidmore <13389701+escidmore@users.noreply.github.com>
Co-authored-by: Chris Yuan <cyuan@hyfin.app>
yjuyjuy added a commit to yjuyjuy/tasks-axi that referenced this pull request Aug 24, 2026
…e no-mistakes gate to the shared action (#6)

* fix(cli): speed up standalone version queries (kunchenguid#34)

* perf(cli): answer --version through the axi-sdk-js fast path

Extract the package-version helper out of the heavy `src/cli.ts` graph into a
leaf `src/version.ts` (node builtins only), and rewrite `bin/tasks-axi.ts` to
answer a bare `-v`/`-V`/`--version` via `axi-sdk-js/fast-path`, dynamically
importing the command graph only for everything else. Bumps axi-sdk-js to
^0.1.10 for the `./fast-path` subpath export.

Version output is byte-identical and all other argv shapes still route through
`runAxiCli` unchanged. Guarded by a deterministic ESM loader module trace with
a negative control plus flag parity; no wall-clock assertion in CI.

* no-mistakes(document): Confirm fast-path docs and lint cleanliness

* no-mistakes: apply CI fixes

* chore(main): release tasks-axi 0.2.5 (kunchenguid#35)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(cli): accept canonical Forgejo pull request URLs (kunchenguid#36)

* fix: accept canonical Forgejo pull request URLs as typed PR links

One classification seam (isPrUrl in src/pr-url.ts) now decides what
counts as a PR URL for prose link derivation, done/add --pr validation,
and public-followup pr_url deliverables: canonical GitHub
https://github.com/<owner>/<repo>/pull/<n> or Forgejo
https://<host>/<owner>/<repo>/pulls/<n> with a positive, no-leading-zero
number. Near misses (issue routes, singular/plural route confusion,
trailing slash, query/fragment, whitespace, userinfo, ports, encoded
separators, malformed segments) are rejected as --pr / pr_url values and
derive as doc links, never pr.

Fixes kunchenguid#19

* fix: validate pr links against the untrimmed input

Review follow-ups from pipeline run 01KZFA73D662DCSJ4HVWKW21QX: --pr values
and pr-kind addLinks are validated before any trim, so whitespace-padded
input is rejected instead of normalized. The literal NUL byte in
test/pr-url.test.ts is now written as a unicode source escape so git
treats the file as text; an embedded-space rejection case is added
alongside it.

* chore: remove committed no-mistakes evidence (now on orphan branch) (kunchenguid#39)

* chore: gitignore no-mistakes evidence dir (contributor safety) (kunchenguid#41)

* chore(agents): use @AGENTS.md import instead of CLAUDE.md symlink (kunchenguid#42)

Co-authored-by: Kun Chen <kun-1@kunchenguid.com>

* ci: require no-mistakes pipeline attestation in the gate (kunchenguid#45)

* ci: require no-mistakes pipeline attestation in the gate

* test: run the no-mistakes gate script on POSIX legs only

* ci: bind the no-mistakes attestation to the current PR head (kunchenguid#46)

* ci: migrate the no-mistakes gate to the shared composite action (kunchenguid#47)

Replace the inline gate `run:` block in
.github/workflows/no-mistakes-required.yml with a thin caller of
kunchenguid/no-mistakes/.github/actions/require-no-mistakes, pinned to an
immutable commit SHA. Enforcement logic and its tests now live upstream, so
this repository no longer carries a hand-copied script that can drift from
its siblings.

Drop `synchronize` from the pull_request trigger: the verdict is a pure
function of the PR body, and the pipeline pushes before it writes the
Pipeline section, so a push-triggered run pinned a failure to a head whose
body the same run was about to fix. This repo's ruleset is advisory with no
required status check, so dropping the trigger cannot wedge a merge.

Remove test/workflows/no-mistakes-gate.test.ts, which extracted and executed
the now-absent inline block, and point AGENTS.md at the shared action.

* fix: make the generated skill defer to live CLI guidance (kunchenguid#48)

* fix(skill): shrink SKILL.md to a CLI-deferring stub

Installed skills go stale when the npm package is bumped. Keep only
identity frontmatter plus pointers to live CLI help so regeneration
cannot re-inflate baked command docs.

Co-authored-by: Cursor <cursoragent@cursor.com>

* no-mistakes(review): Align skill documentation with minimal generator contract

* no-mistakes(document): Consolidate generated skill documentation

---------

Co-authored-by: Cursor <cursoragent@cursor.com>

* no-mistakes: apply CI fixes

---------

Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Evelyn Scidmore <13389701+escidmore@users.noreply.github.com>
Co-authored-by: Kun Chen <kun-1@kunchenguid.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Chris Yuan <cyuan@hyfin.app>
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