Skip to content

fix(models): disable lifecycle scripts during catalog inspection - #157

Merged
pierreraby merged 3 commits into
mainfrom
fix-catalog-sync
Oct 17, 2026
Merged

pierreraby merged 3 commits into
mainfrom
fix-catalog-sync

Conversation

@patlux

@patlux patlux commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Updated scope after #153 merged

The CLI registry parser repair and complete 1.82.4 catalog/pricing refresh were independently integrated into main through #153 while this work was running. This PR now preserves only the remaining package-inspection changes:

  • Pass --ignore-scripts to npm pack when inspecting upstream CLI metadata. Defense-in-depth only: for a registry spec (command-code@x.y.z) npm downloads the published tarball through pacote and prepack/postpack run for directory specs only, so this flag does not change behavior today.
  • Narrow parsed JSON from unknown without type assertions.
  • Keep main's fail-closed modalities parser and regression tests unchanged.

Verification

  • Typecheck, all 48 model/parser tests, formatting and diff checks: PASS.
  • Read-only catalog comparison with current CLI 1.82.4: PASS.
  • The earlier full suite also passed against real Pi/OMP mock APIs.
  • Update 0a5adc7 merges current main and drops the Unreleased changelog entry per review (this is a CI-script-only change); the diff against main is now .github/scripts/check-commandcode-model-metadata.ts alone.

The duplicate catalog refresh PR #160 is superseded by merged #153. No publication or merge is performed here.

@patlux patlux self-assigned this Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Memory benchmark

Compared base db1781c with PR head 0a5adc7 on the same GitHub-hosted darwin runner. Lower values are better.

Metric Base PR PR − Base Change
Stable RSS 120.6 MiB ± 1.1 MiB 120.3 MiB ± 0.6 MiB -0.7 MiB ± 1.1 MiB -0.6%
Physical footprint 67.0 MiB ± 0.7 MiB 67.0 MiB ± 1.1 MiB +0.1 MiB ± 1.5 MiB +0.2%
Physical peak 78.9 MiB ± 1.1 MiB 78.4 MiB ± 0.3 MiB -0.1 MiB ± 1.9 MiB -0.1%

Interpretation: No metric shows a clear Base-to-PR difference beyond its measured run-to-run variation.

Extension overhead above pi baseline

Metric Base overhead PR overhead Difference
Stable RSS +6.3 MiB ± 0.9 MiB +5.5 MiB ± 0.8 MiB -0.7 MiB ± 1.1 MiB
Physical footprint +4.3 MiB ± 0.7 MiB +3.7 MiB ± 0.7 MiB +0.1 MiB ± 1.5 MiB
Physical peak +4.7 MiB ± 0.3 MiB +4.2 MiB ± 1.1 MiB -0.1 MiB ± 1.9 MiB

Values are medians of 6 alternating, paired runs. The value after ± is the median absolute deviation (MAD). Each process was sampled 12 times after a 2500 ms warm-up.

Environment: pi 0.84.4, Bun 1.4.0, darwin arm64. RSS comes from ps; physical footprint and peak come from macOS footprint.

This is a comparative signal, not a pass/fail threshold. GitHub-hosted runner noise can affect absolute values.

@patlux patlux changed the title fix(models): restore catalog sync after CLI registry changes fix(models): disable lifecycle scripts during catalog inspection Oct 15, 2026

@patlux patlux left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Small and safe to merge. Two notes inline, plus one on the branch itself:

The branch still carries 6ec9987 fix(models): parse explicit CLI input modalities, which duplicates 0fedb7a already on main. Squash-merge (using the PR title) or rebase to drop it; a rebase-merge would add a duplicate commit to history.

Comment thread .github/scripts/check-commandcode-model-metadata.ts
Comment thread CHANGELOG.md Outdated
pierreraby
pierreraby previously approved these changes Oct 16, 2026

@pierreraby pierreraby left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. Verified locally at the exact head in an isolated worktree (npm ci): tsc --noEmit PASS, test-model-metadata-check 19/19, full test:unit exit 0 (401 checks), Prettier + git diff --check PASS. Upstream CI fully green.

The narrowed scope is right: parser repair already landed via #153, and this retains only the still-missing npm pack --ignore-scripts hardening plus the unknown-typed JSON.parse results. Small, safe, well-tested.

karaaslanz
karaaslanz previously approved these changes Oct 16, 2026

@karaaslanz karaaslanz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requested co-maintainer follow-up at pinned head f699917d823644bc18d7cec9fad083339940d65d of #157. I independently fetched the exact .github/scripts/check-commandcode-model-metadata.ts blob 1294f99db6ad278eca9f5460defe399aa2cec43d and CHANGELOG.md blob cbd5de4a4f414f40c65ff24209f0d85af5571ca9 and rechecked the two-file patch.

Six scoped source assertions passed: npm pack argv contains --ignore-scripts before --json; both package JSON parsing sites retain equivalent parsing with explicit unknown typing; tar extraction remains unchanged; and the disputed changelog wording remains present. I agree with @patlux's correction that for registry tarball specs this flag is defense-in-depth, not a demonstrated lifecycle-script execution fix. Its presence causes no new behavior for a published registry package. The head's CI/typecheck/security gates are successful, and @pierreraby independently ran the full test suite.

Approval scope: the small implementation delta is acceptable, not an assertion that registry package execution was previously unsafe; I did not run real npm pack or the full project tests. The owner's editorial requests still deserve follow-up: remove the CI-only changelog entry and avoid rebase-merge of the duplicate parser commit (squash if merging). Restricting tar extraction to required members is a separate useful hardening improvement. This approval does not authorize a merge or bypass branch protections; merge/release remain maintainer decisions.

@pierreraby
pierreraby dismissed stale reviews from karaaslanz and themself via 0a5adc7 October 17, 2026 08:24
@pierreraby
pierreraby merged commit f993145 into main Oct 17, 2026
14 of 15 checks passed
@pierreraby
pierreraby deleted the fix-catalog-sync branch October 17, 2026 08:34
@pierreraby

Copy link
Copy Markdown
Collaborator

Merged as f993145 (squash, PR title per @patlux's note on the duplicate commit).

What the update 0a5adc7 did, so the trail is complete:

  • Merged current main in; the Unreleased changelog entry was dropped entirely per the review note (CI-script-only change, CONTRIBUTING). The diff against main was .github/scripts/check-commandcode-model-metadata.ts alone, +13/−3.
  • PR body reworded: --ignore-scripts is now presented as defense-in-depth for registry specs, not as a hardening fix.
  • Both review threads answered and resolved.

One transparency note: pushing the update auto-dismissed the existing approvals (repo policy), so this landed with the review threads resolved and @patlux's "small and safe to merge" assessment above rather than a fresh approval round — the only delta versus the reviewed head f699917 is the removed changelog line and the merge of main.

FYI the check job is currently red on every PR for environmental reasons (CLI 1.84.0 published after #167's CI ran → version-string drift only; plus reflection/beam:free newly advertised by the API without a local price entry). Unrelated to this PR — tracked separately.

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.

3 participants