Migrate JSONC reader + line locators to agent-gov-core@v0.1.1#35
Merged
Conversation
Replaces local hand-rolled JSON.parse and regex line locators with the shared primitives. Side-effect: JSONC comments and trailing commas are now stripped before parsing — the previous implementation would have thrown on Claude settings with `//` comments. The async ENOENT wrapper stays here because that's ScopeTrail-specific behavior (missing settings = empty config, not a parse error). All 37 existing tests pass against the migrated reader. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Action used to run dist/index.js directly without npm install, which worked when ScopeTrail had no runtime deps. Now that discovery.ts imports agent-gov-core, the action needs to populate node_modules first. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The pre-migration invariant 'no npm ci in action.yml' is replaced with 'no npm run build at action time' — dist/ is still committed and consumers still skip the TypeScript compile, but they do an --omit=dev install so runtime imports (now including agent-gov-core) resolve. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JSON.parse. The old reader would have thrown on Claude settings files containing//comments.Deletes the local copies of
escapeRegExp,lineOfPattern, and the rawJSON.parsepath;lineOfJsonKey/lineOfJsonStringValuenow thinly wrap the core implementations to preserve the existingnumber | undefinedreturn shape.Test plan
npm run build— clean tsc buildnpm test— 37/37 existing tests pass against the migrated reader🤖 Generated with Claude Code