Skip to content

Migrate line locators to agent-gov-core@v0.1.2#16

Merged
Conalh merged 1 commit into
mainfrom
migrate-locators-to-agent-gov-core
May 22, 2026
Merged

Migrate line locators to agent-gov-core@v0.1.2#16
Conalh merged 1 commit into
mainfrom
migrate-locators-to-agent-gov-core

Conversation

@Conalh
Copy link
Copy Markdown
Owner

@Conalh Conalh commented May 22, 2026

Mirrors the TaskBound #24 and PolicyMesh #40 pattern.

Summary

  • Adds agent-gov-core@v0.1.2 (via github:Conalh/agent-gov-core#v0.1.2) to dependencies.
  • Replaces local lineOfJsonKey / lineOfJsonStringValue regex implementations with thin wrappers around the core versions. Translates core's 0 means not-found convention back to undefined so the existing call sites are unchanged.
  • readJsonObjectWithSource stays local — CapabilityEcho's package.json reads are real JSON, not JSONC, so the core JSONC reader is unneeded here.

Why now

Fourth tool in the breadth-migration sweep. Once this and ScopeTrail's migration land, all five suite tools depend on the same core library, and the namespace finding-kinds wave (agent-gov-core#1) becomes the next coordinated work.

Verification

  • npm install && npm run build — clean
  • npm test64/64 passing on existing kind-string assertions (no behavior change)

Test plan

  • CI build-test passes
  • CapabilityEcho self-dogfood reports against this PR

Mirrors the TaskBound #24 and PolicyMesh #40 pattern: replaces the
local lineOfJsonKey / lineOfJsonStringValue regex implementations
with delegation to agent-gov-core, keeping a thin wrapper that
translates core's '0 means not-found' convention back to undefined
for the existing call sites.

readJsonObjectWithSource stays local (CapabilityEcho's package.json
files are real JSON, not JSONC — no need for the core JSONC reader).

Pure refactor — no kind-string changes, no behavior changes, 64/64
tests still passing on existing assertions.
@Conalh Conalh merged commit 6513f83 into main May 22, 2026
4 checks passed
@Conalh Conalh deleted the migrate-locators-to-agent-gov-core branch May 22, 2026 16:09
Conalh added a commit that referenced this pull request May 22, 2026
CapabilityEcho's action.yml uses 'using: node24, main: dist/action.js' —
GitHub's node24 runner invokes the main file directly without any
'npm install' step, so every runtime dep must be vendored.

When PR #16 migrated discovery.ts to import from agent-gov-core, that
broke the published Action: dist/action.js eventually resolves
'agent-gov-core' which isn't in the published tarball's tree. Real
production bug — any external consumer of Conalh/CapabilityEcho@main
was hitting ERR_MODULE_NOT_FOUND on first run.

Fix:
- @vercel/ncc as devDep
- 'bundle-action' npm script: ncc bundles src/action.ts into a single
  self-contained dist/action-bundle/index.js with all transitive deps
  (including agent-gov-core) inlined. 57KB minified.
- action.yml main: dist/action-bundle/index.js
- Test asserting the action.yml main path updated accordingly.

This is the standard pattern for Node-runtime GitHub Actions (used by
actions/checkout, etc.). Other suite tools (TaskBound, PolicyMesh,
SessionTrail, ScopeTrail) use 'using: composite' with npm ci + npm run
build at runtime, which handles deps differently and doesn't have this
problem — only CapabilityEcho needed the bundler.
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