fix(grok): keep plugin ids distinct and union config plugin tables - #55
Merged
Conversation
The realpath dedupe added while addressing review feedback rewrote every plugin id to grok/plugin/<dirname>, so a user-scope and a project-scope plugin sharing a directory name collapsed onto one id. asset-integrity groups name collisions and then dedupes by id, which silenced the plugin-name-collision finding exactly where it is needed, and checkup apply resolves plugins by id. Plugin records now keep their discovery-root qualified id while the dedupe map stays keyed on realpath. The user and project [plugins] tables were concatenated into one text and parsed once, so a project-declared paths key replaced the user-declared one. Each config is parsed separately now and paths/enabled/disabled are unioned. diagnostics.configPath again always names the user config and is null when the user home is out of scope, with projectConfigPath carrying the project file. Nested turn usage.modelUsage values fill any field flat usage omitted instead of only totalTokens, so partial flat records stay complete. render-report exports its host allowlist, pinned by a new test against the session platform registry, together with coverage for the .grok/better-harness default route, fail-closed unknown platforms, and --help staying usable with an invalid platform. Spec updated for the id, config-union, and usage behavior plus the new Grok-A4 project-scope criterion. Validated with npm test (1109 pass) and npm run pack:verify. Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
6 tasks
creayma-del
pushed a commit
to creayma-del/better-harness
that referenced
this pull request
Aug 3, 2026
…ess-gate Integrate main (PRs QoderAI#51-QoderAI#55) into the loop-readiness feature branch. Resolved conflict in test/scripts-refactor-contract.test.mjs: - Recalculated sha256 baselines for `commands --json` and `schema` to reflect the merged command registry (Grok host adapter added by PR QoderAI#52). All 1120 tests pass after merge.
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
Follow-up to #52 review round 3. The realpath dedupe added there also rewrote every Grok plugin id to
grok/plugin/<dirname>, which broke id uniqueness, and the user/project[plugins]tables were merged by concatenating config text, which let one config replace the other'spaths.Changes
grok/<install-match>/<name>) while the dedupe map stays keyed onrealpath. Two different roots that share a directory name (~/.grok/plugins/flowand<ws>/.grok/plugins/flow) previously collapsed onto one id;scripts/coding-agent-practices/asset-integrity.mjsgroups name collisions and then dedupes by id, so theplugin-name-collisionfinding was silenced exactly where it is needed, andcheckup/apply.mjsresolves plugins by id.config.tomlis parsed separately andpaths/enabled/disabledare unioned, so a project-declaredpathsno longer drops user-declared plugin roots.diagnostics.configPathhas one meaning again. It always names the user config and isnullwhen the user home is out of scope;projectConfigPathcarries the project file.usage.modelUsage.<modelId>values now fill any field flat usage omitted, not onlytotalTokens.render-report.mjsexportsRENDER_REPORT_PLATFORMS, and a test asserts it matchesSUPPORTED_SESSION_PLATFORMSso a new host adapter cannot drift out of report routing.Test evidence
New coverage: distinct plugin roots keep distinct ids; user + project
pathsunion; project-scope inventory records no user-home paths and no user config path; html routing to.grok/better-harnesswith fail-closed unknown platforms and--helpstill usable; partial flat + nested turn usage.npm test— 1121 pass, 0 failnpm run pack:verify— passedSpec
docs/specs/2026-08-02-grok-host-adapter.mdupdated for the id, config-union, and usage behavior, plus a newGrok-A4project-scope criterion.