Skip to content

fix(grok): keep plugin ids distinct and union config plugin tables - #55

Merged
phodal merged 1 commit into
mainfrom
fix/grok-adapter-review-followup
Aug 3, 2026
Merged

fix(grok): keep plugin ids distinct and union config plugin tables#55
phodal merged 1 commit into
mainfrom
fix/grok-adapter-review-followup

Conversation

@phodal

@phodal phodal commented Aug 3, 2026

Copy link
Copy Markdown
Member

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's paths.

Changes

  • Plugin ids stay distinct. Records keep their discovery-root qualified id (grok/<install-match>/<name>) while the dedupe map stays keyed on realpath. Two different roots that share a directory name (~/.grok/plugins/flow and <ws>/.grok/plugins/flow) previously collapsed onto one id; scripts/coding-agent-practices/asset-integrity.mjs groups name collisions and then dedupes by id, so the plugin-name-collision finding was silenced exactly where it is needed, and checkup/apply.mjs resolves plugins by id.
  • Config lists are unioned, not overridden. Each config.toml is parsed separately and paths / enabled / disabled are unioned, so a project-declared paths no longer drops user-declared plugin roots.
  • diagnostics.configPath has one meaning again. It always names the user config and is null when the user home is out of scope; projectConfigPath carries the project file.
  • Partial turn usage stays complete. Nested usage.modelUsage.<modelId> values now fill any field flat usage omitted, not only totalTokens.
  • Render platform allowlist is pinned. render-report.mjs exports RENDER_REPORT_PLATFORMS, and a test asserts it matches SUPPORTED_SESSION_PLATFORMS so a new host adapter cannot drift out of report routing.

Test evidence

New coverage: distinct plugin roots keep distinct ids; user + project paths union; project-scope inventory records no user-home paths and no user config path; html routing to .grok/better-harness with fail-closed unknown platforms and --help still usable; partial flat + nested turn usage.

  • npm test — 1121 pass, 0 fail
  • npm run pack:verify — passed

Spec docs/specs/2026-08-02-grok-host-adapter.md updated for the id, config-union, and usage behavior, plus a new Grok-A4 project-scope criterion.

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>
@phodal phodal mentioned this pull request Aug 3, 2026
6 tasks
@phodal
phodal merged commit 1288f8c into main Aug 3, 2026
4 checks passed
@phodal
phodal deleted the fix/grok-adapter-review-followup branch August 3, 2026 04:21
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.
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