Skip to content

fix: anchor catalog type extraction regex to export block#1112

Closed
keeb wants to merge 12 commits intomainfrom
fix/catalog-type-regex-1110
Closed

fix: anchor catalog type extraction regex to export block#1112
keeb wants to merge 12 commits intomainfrom
fix/catalog-type-regex-1110

Conversation

@keeb
Copy link
Copy Markdown
Contributor

@keeb keeb commented Apr 6, 2026

Summary

Fixes #1110

  • Root cause: The catalog population regex /type\s*:\s*["']([^"']+)["']/ matched the first type: "..." anywhere in a model source file. In issue_lifecycle.ts, type: "feature" on line 81 (inside a sc.ensureIssue() call) was matched before the actual type: "@si/issue-lifecycle" on line 113, permanently poisoning the extension catalog.
  • Fix: Anchor both type and version regexes to the export const (model|extension) = { block using /export\s+const\s+(?:model|extension)\s*=\s*\{[\s\S]*?type\s*:\s*["']([^"']+)["']/
  • Test: Added regression test with a decoy type: property before the export block
  • Skill: Added Phase 0 (Environment Setup) to issue-lifecycle skill for worktree init and SWAMP_MODELS_DIR guidance in scratch repos

Test Plan

  • New unit test: catalog extracts type from export block, not from decoy properties passes
  • All 484 model domain tests pass
  • deno check passes
  • deno lint clean (pre-existing worktree issues only)
  • deno fmt clean
  • Manual verification: cleared catalog, ran model create @si/issue-lifecycle, confirmed catalog stores @si/issue-lifecycle (not feature), subsequent commands work without clearing catalog

🤖 Generated with Claude Code

The catalog population regex matched the first `type: "..."` anywhere
in a model source file instead of the one inside `export const model`.
In issue_lifecycle.ts, `type: "feature"` on line 81 (inside a helper
function call) was matched before the actual `type: "@si/issue-lifecycle"`
on line 113, permanently poisoning the catalog and making the model
undiscoverable.

Fix both the type and version regexes to anchor on the
`export const (model|extension) = {` block. Add a regression test
with a decoy `type:` property before the export block.

Also add Phase 0 (Environment Setup) to the issue-lifecycle skill for
worktree initialization and SWAMP_MODELS_DIR guidance in scratch repos.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
github-actions[bot]
github-actions bot previously approved these changes Apr 6, 2026
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

CI Security Review

Critical / High

None.

Medium

None.

Low

None.

Verdict

PASS — The only workflow change is downgrading Node.js from v24 to v22 in the skill-trigger-eval job (ci.yml:165). This is security-neutral — no changes to triggers, permissions, secrets handling, action pins, prompt templates, or tool scoping.

github-actions[bot]
github-actions bot previously approved these changes Apr 6, 2026
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

CI Security Review

Critical / High

None.

Medium

None.

Low

None.

Verdict

PASS — The only workflow change is adding NODE_OPTIONS: "--experimental-require-module" as an environment variable to the skill-trigger-eval job (line 170). This is a benign Node.js runtime flag with no security implications. No new triggers, permissions, expression interpolations, or third-party actions were introduced. The remaining changes are to skill documentation and domain logic source files, which are outside the CI security review scope.

promptfoo's transitive dep @asamuzakjp/css-color@5.1.5 (via jsdom)
uses top-level await, breaking Node's require(). Pass the flag through
Deno.Command env so the npx subprocess can load it.
keeb added 6 commits April 5, 2026 20:34
Version 5.1.5 uses top-level await in its ESM entry, which Node
cannot require() (ERR_REQUIRE_ASYNC_MODULE). Write a temporary
package.json with overrides to pin the working version.
npx -y ignores local package.json overrides, so the css-color pin
had no effect. Switch to npm install + local npx to enforce the
@asamuzakjp/css-color@5.1.4 override.
Node 22+ rejects require() of ESM modules with top-level await
(ERR_REQUIRE_ASYNC_MODULE). promptfoo's transitive dep chain
jsdom → @asamuzakjp/css-color@5.1.5 triggers this. Node 20 LTS
does not have this restriction. Reverts script changes and just
pins the CI node version.
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

CI Security Review

Critical / High

None.

Medium

None.

Low

None.

Verdict

PASS — The only workflow change is pinning Node.js from v24 to v20 LTS in the skill-trigger-eval job (.github/workflows/ci.yml:165-168). This is a security-neutral version pin change with no impact on triggers, permissions, secrets, expression interpolation, or tool scoping.

@stack72
Copy link
Copy Markdown
Contributor

stack72 commented Apr 7, 2026

superceeded by #1121 & #1115

@stack72 stack72 closed this Apr 7, 2026
@stack72 stack72 deleted the fix/catalog-type-regex-1110 branch April 7, 2026 16:23
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.

issue-lifecycle skill fails in worktrees: missing init and dev extension model resolution

2 participants