[PR #3469] [MERGED] fix(opencode): override inherited disabled flags #5760

Closed
opened 2026-10-31 01:09:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3469
Author: @CmsChase
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @morluto

Base: main ← Head: fix/opencode-v2-registration-activation


📝 Commits (1)

  • bcfdedd fix(opencode): override inherited disabled flags

📊 Changes

4 files changed (+182 additions, -3 deletions)

View changed files

📝 src/application/ClientConfigurationDocument.ts (+2 -1)
➕ tests/acceptance/setup/opencodeV2ClientSetup.test.ts (+154 -0)
📝 tests/boundary/filesystem/clientConfigurationDialects.test.ts (+4 -2)
📝 tests/process-global/updateMaintenance.test.ts (+22 -0)

📄 Description

fix(opencode): override inherited disabled flags

Summary

Fixes #3318. Explicitly activate OpenCode V2 registrations created by approved setup so an inherited disabled flag cannot keep setup and doctor stale.

Problem and expected behavior

When a lower-priority configuration contains disabled: true, the generated upper registration previously omitted that field. Recursive merging retained the disabled state: setup wrote the registration but exited 1 with needs_human/stale; repeating setup planned zero actions and still failed. Explicit setup should activate the selected integration.

Change and scope

Set disabled: false in the native V2 entry producer. Preserve the existing merge and diagnostic rules, lower configuration bytes, backups and other client dialects. Automatic maintenance continues to exclude disabled registrations; a regression covers that boundary.

Contract and boundary impact

  • Semantic owner and earliest changed stage: clientRegistrationEntry, native OpenCode V2 registration construction.
  • Contribution scope fit and linked maintainer decision: ordinary fix within existing approved setup boundaries; advance scope decision not applicable.
  • CLI and MCP/tool-catalog contract: setup and doctor can reach readiness after explicit setup; no command, schema or catalog changes.
  • Provider, bridge, target-format, or platform compatibility: no provider/bridge changes; Windows x64 REA CLI exercised.
  • Evidence, artifact, provenance, or reconstruction contract: no analysis-evidence changes; configuration bytes and exact backups are covered.
  • Target selection, authority, upstream behavior, and cleanup details: existing setup approval governs upper configuration writes. Lower settings remain untouched; disabled clients remain excluded from automatic maintenance. No new target interaction or cleanup behavior.
  • Generated metadata, package, or installation impact: no metadata, dependencies or package-layout changes. The existing setup registration gains an explicit activation field.

Expected effects of the registration workflow:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

The configuration effect is the existing approved upper registration write.

Evidence and regression coverage

  • Five real CLI cases cover JSON/JSONC, inherited disabled/enabled controls, idempotence, doctor readiness, exact backups, preserved lower settings and unrelated entries, retained JSONC comments, and malformed-lower-configuration refusal.

  • On unchanged production source at a32b4b6ac54a02a8fe9a7cb62861e54473ba5eb0, the two inherited-disabled cases fail and the other three pass. With the fix, all five pass.

  • An additional automatic-maintenance control verifies that an inherited disabled V2 registration is not selected and neither configuration layer changes. Two native V2 registration expectations are updated.

  • Independent CLI replay made 12 calls: first setup, repeated setup and doctor for disabled/enabled fixtures on both versions. Disabled-fixture exits changed from 1/1/1 to 0/0/0; enabled controls remained 0/0/0. Setup readiness changed from needs_human/stale to ready/aligned; repeated setup still plans zero actions.

  • Remaining proof gaps: no installed OpenCode client, live provider, POSIX host, full suite/CI or successful complete package verification was exercised.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Windows x64, Node 24.18.0, npm 11.16.0, locked dependencies:

  • npm run test:focused -- tests/acceptance/setup/opencodeV2ClientSetup.test.ts — baseline 2 failed / 3 passed; fixed 5 passed.
  • npm exec --no -- vitest run --project process-global tests/process-global/updateMaintenance.test.ts -t "maintenance activation and layered configuration" — 4 passed; 23 unrelated tests unselected.
  • npm run test:focused -- tests/boundary/filesystem/clientConfigurationDialects.test.ts tests/boundary/filesystem/clientConfigurationLayeredEnvironment.test.ts tests/boundary/filesystem/clientConfigurationEnvironment.test.ts tests/boundary/filesystem/clientRegistrationStatus.test.ts — baseline and fixed each 55 passed / 21 failed. All 21 failure names, primary errors and normalized assertion signatures match. Failures concern unchanged POSIX launcher expectations and host path spelling; the layered-environment 8/8 and environment 22/22 cases pass.
  • npm run check — passed: typecheck, formatting, lint, knip, metadata, module boundaries and architecture guards. Lint reports 0 errors / 1381 warnings; changed-file warning categories are unchanged from baseline.
  • npm run verify:test-discovery — 1274 test files discovered exactly once.
  • npm pack --dry-run --json — passed, 1648 entries.
  • npm run verify:package — baseline and fixed fail at the repository-skill stage with Windows spawn npm ENOENT, before package installation.
  • npm run verify:package:windows — baseline and fixed fail with Windows package omitted native/windows/build/manifest.json. The source checkout lacks the official native artifacts, which require the documented Linux/MinGW preparation path.
  • git diff --check and the normal staged formatting/lint commit hook — passed. The committed diff is byte-identical to the reviewed and validated diff.

Compatibility, safety, and release

  • Breaking changes or migration steps: none intended. Explicit setup activates the selected V2 integration; automatic maintenance retains its activation gate.
  • Real Hopper/Ghidra, browser, or OS coverage: Windows REA CLI with isolated configuration roots; no installed client, live provider or POSIX coverage claimed.
  • Package or release metadata impact: unchanged. Complete package verification remains unavailable for the errors above; pack dry-run does not establish installed-package correctness.
  • Security, privacy, process, or containment review: writes remain within approved setup. Malformed lower settings still block writes; lower bytes, unrelated settings and backups remain preserved. No new execution, network or target mutation capability.

Author readiness

Human owner: @CmsChase

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3469 **Author:** [@CmsChase](https://github.com/CmsChase) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/opencode-v2-registration-activation` --- ### 📝 Commits (1) - [`bcfdedd`](https://github.com/morluto/rea/commit/bcfdedd8fc9c90d5d4e4c6dd0e79eda688e4d541) fix(opencode): override inherited disabled flags ### 📊 Changes **4 files changed** (+182 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ClientConfigurationDocument.ts` (+2 -1) ➕ `tests/acceptance/setup/opencodeV2ClientSetup.test.ts` (+154 -0) 📝 `tests/boundary/filesystem/clientConfigurationDialects.test.ts` (+4 -2) 📝 `tests/process-global/updateMaintenance.test.ts` (+22 -0) </details> ### 📄 Description # fix(opencode): override inherited disabled flags ## Summary Fixes #3318. Explicitly activate OpenCode V2 registrations created by approved setup so an inherited disabled flag cannot keep setup and doctor stale. ## Problem and expected behavior When a lower-priority configuration contains `disabled: true`, the generated upper registration previously omitted that field. Recursive merging retained the disabled state: setup wrote the registration but exited 1 with `needs_human`/`stale`; repeating setup planned zero actions and still failed. Explicit setup should activate the selected integration. ## Change and scope Set `disabled: false` in the native V2 entry producer. Preserve the existing merge and diagnostic rules, lower configuration bytes, backups and other client dialects. Automatic maintenance continues to exclude disabled registrations; a regression covers that boundary. ## Contract and boundary impact - Semantic owner and earliest changed stage: `clientRegistrationEntry`, native OpenCode V2 registration construction. - Contribution scope fit and linked maintainer decision: ordinary fix within existing approved setup boundaries; advance scope decision not applicable. - CLI and MCP/tool-catalog contract: setup and doctor can reach readiness after explicit setup; no command, schema or catalog changes. - Provider, bridge, target-format, or platform compatibility: no provider/bridge changes; Windows x64 REA CLI exercised. - Evidence, artifact, provenance, or reconstruction contract: no analysis-evidence changes; configuration bytes and exact backups are covered. - Target selection, authority, upstream behavior, and cleanup details: existing setup approval governs upper configuration writes. Lower settings remain untouched; disabled clients remain excluded from automatic maintenance. No new target interaction or cleanup behavior. - Generated metadata, package, or installation impact: no metadata, dependencies or package-layout changes. The existing setup registration gains an explicit activation field. Expected effects of the registration workflow: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [x] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. The configuration effect is the existing approved upper registration write. ## Evidence and regression coverage - Five real CLI cases cover JSON/JSONC, inherited disabled/enabled controls, idempotence, doctor readiness, exact backups, preserved lower settings and unrelated entries, retained JSONC comments, and malformed-lower-configuration refusal. - On unchanged production source at `a32b4b6ac54a02a8fe9a7cb62861e54473ba5eb0`, the two inherited-disabled cases fail and the other three pass. With the fix, all five pass. - An additional automatic-maintenance control verifies that an inherited disabled V2 registration is not selected and neither configuration layer changes. Two native V2 registration expectations are updated. - Independent CLI replay made 12 calls: first setup, repeated setup and doctor for disabled/enabled fixtures on both versions. Disabled-fixture exits changed from `1/1/1` to `0/0/0`; enabled controls remained `0/0/0`. Setup readiness changed from `needs_human`/`stale` to `ready`/`aligned`; repeated setup still plans zero actions. - Remaining proof gaps: no installed OpenCode client, live provider, POSIX host, full suite/CI or successful complete package verification was exercised. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Windows x64, Node 24.18.0, npm 11.16.0, locked dependencies: - `npm run test:focused -- tests/acceptance/setup/opencodeV2ClientSetup.test.ts` — baseline 2 failed / 3 passed; fixed 5 passed. - `npm exec --no -- vitest run --project process-global tests/process-global/updateMaintenance.test.ts -t "maintenance activation and layered configuration"` — 4 passed; 23 unrelated tests unselected. - `npm run test:focused -- tests/boundary/filesystem/clientConfigurationDialects.test.ts tests/boundary/filesystem/clientConfigurationLayeredEnvironment.test.ts tests/boundary/filesystem/clientConfigurationEnvironment.test.ts tests/boundary/filesystem/clientRegistrationStatus.test.ts` — baseline and fixed each 55 passed / 21 failed. All 21 failure names, primary errors and normalized assertion signatures match. Failures concern unchanged POSIX launcher expectations and host path spelling; the layered-environment 8/8 and environment 22/22 cases pass. - `npm run check` — passed: typecheck, formatting, lint, knip, metadata, module boundaries and architecture guards. Lint reports 0 errors / 1381 warnings; changed-file warning categories are unchanged from baseline. - `npm run verify:test-discovery` — 1274 test files discovered exactly once. - `npm pack --dry-run --json` — passed, 1648 entries. - `npm run verify:package` — baseline and fixed fail at the repository-skill stage with Windows `spawn npm ENOENT`, before package installation. - `npm run verify:package:windows` — baseline and fixed fail with `Windows package omitted native/windows/build/manifest.json`. The source checkout lacks the official native artifacts, which require the documented Linux/MinGW preparation path. - `git diff --check` and the normal staged formatting/lint commit hook — passed. The committed diff is byte-identical to the reviewed and validated diff. ## Compatibility, safety, and release - Breaking changes or migration steps: none intended. Explicit setup activates the selected V2 integration; automatic maintenance retains its activation gate. - Real Hopper/Ghidra, browser, or OS coverage: Windows REA CLI with isolated configuration roots; no installed client, live provider or POSIX coverage claimed. - Package or release metadata impact: unchanged. Complete package verification remains unavailable for the errors above; pack dry-run does not establish installed-package correctness. - Security, privacy, process, or containment review: writes remain within approved setup. Malformed lower settings still block writes; lower bytes, unrelated settings and backups remain preserved. No new execution, network or target mutation capability. ## Author readiness Human owner: @CmsChase - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:09:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5760
No description provided.