[PR #6366] feat(companions): prototype inactive checked-text loading #7311

Open
opened 2026-11-01 21:46:57 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6366
Author: @ShadowSwaps
Created: 10/22/2026
Status: 🔄 Open

Base: main ← Head: feat/4718-companion-loading-prototype


📝 Commits (2)

  • 6aac9a1 feat(companions): prototype inactive checked-text loading contract
  • cd99f62 fix(companions): refuse malformed migration state records

📊 Changes

6 files changed (+736 additions, -0 deletions)

View changed files

➕ docs/specs/4718-companion-loading-prototype/LICENSE.fixture (+23 -0)
➕ docs/specs/4718-companion-loading-prototype/README.md (+150 -0)
➕ docs/specs/4718-companion-loading-prototype/legacy-block.fixture.md (+29 -0)
➕ docs/specs/4718-companion-loading-prototype/migration.mjs (+40 -0)
➕ docs/specs/4718-companion-loading-prototype/prototype.test.mjs (+249 -0)
➕ docs/specs/4718-companion-loading-prototype/resolver.mjs (+245 -0)

📄 Description

Summary

I propose an inactive, dependency-free checked-text loading experiment for the contract in #4970, related to #4718. This separate draft provides code and isolated fixtures for discussion; it does not integrate companion loading.

Problem and expected behavior

A companion block changes REA's canonical skill bytes. The experiment instead returns checked text from an exact, explicitly selected local grant. Automatic loading remains inactive because the trusted host/profile and fresh-session delivery prerequisites are unresolved.

Change and scope

Six files under docs/specs/4718-companion-loading-prototype/:

  • Bounded, read-only manual resolver with closed versioned schemas, exact content identity, per-selection grants and checked-buffer provenance.
  • Value-only registration/disable approval plans and separate health facts.
  • Exact marked-block removal planning against current fixture bytes, preserving all surrounding/state bytes and transferring no consent.
  • Candidate routing text, an attributed legacy fixture and 29 Node tests.

The fail-closed integration rule applies. Loader choice, trusted profile/registry/executable binding and installation ownership remain pending maintainer decisions. There is no active canonical skill edit, CLI/MCP command, host adapter, persistence API, setup/update/doctor wiring or production migration writer. This directory is excluded from the npm file list.

Contract and boundary impact

  • Semantic owner: experimental manual resolver and value transforms; production ownership remains a design decision.
  • Scope decision: pending; exploratory draft only, no integration.
  • CLI/MCP/tool catalog, providers and target formats: unchanged.
  • Provenance: checked text identifies selected ID, manifest digest, base directory and inventoried path. Manual selection is not host identity proof.
  • Effects: resolver reads explicitly selected local files; tests create and remove their own temporary fixtures, including hard links/junctions. No package helpers execute. No network, repair, installed-skill/config writes, target execution, injection or protection recovery is implemented.
  • Package/generated metadata: unchanged; the prototype is outside package.json#files.

Expected effects:

  • Read existing files or captured data.
  • Change files in isolated test fixtures only.

Evidence and regression coverage

Executed on Windows with Node 24.21.0 (repository toolchain pin: 24.18.0):

  • node --test docs/specs/4718-companion-loading-prototype/prototype.test.mjs — final 29/29 passed outside the sandbox, including exact selection/consent, disabled/irrelevant behavior, schema/path/content failures, hard links/junctions, partial package updates and fixture migration.
  • Original sandbox run: 28/29; fixture creation failed with EPERM on a hard link. The same suite passed outside the sandbox. That was an environment retry, not a product fix.
  • node --check for all three modules — passed.
  • git diff --cached --check — passed.
  • npm run check and npm run docs:check — both stopped at the dependency guard because this checkout has no installed locked dependencies. No dependency installation was authorized or performed.
  • npm pack --dry-run --ignore-scripts --offline --json — zero prototype entries in the unbuilt checkout's file list. This is exclusion evidence only, not a package build or setup verification.

Full static/docs/source/packaging/test-discovery gates remain unverified. Prototype tests are explicitly invoked outside normal Vitest roots; CI does not implicitly certify them.

Compatibility, safety, and release

Canonical-byte checks and the companion repository are unchanged. Migration is a pure plan over a named fixture state, not conversion of the released updater schema. Production interrupted-write/readback/rollback and actual host delivery are unverified. File snapshots detect observed changes but do not establish an atomic multi-file snapshot, same-user tamper isolation or complete platform reparse protection. Inventory completeness and released companion size fit are not established.

Before integration: maintainer contract decision; one genuine pinned fresh-session adapter proof; typed shared contracts and owned filesystem/persistence integration; actual setup/update/doctor and companion migration coverage; applicable full checks and substantive non-author review. No merge, release or installed configuration mutation is requested by this draft.

Author readiness

Human owner: @ShadowSwaps

  • 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

  • Material scope, authority and required maintainer decisions cover the final diff.
  • Required validation and real-host proof gaps are resolved.
  • Substantive non-author review and human readiness are complete.

🔄 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/6366 **Author:** [@ShadowSwaps](https://github.com/ShadowSwaps) **Created:** 10/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/4718-companion-loading-prototype` --- ### 📝 Commits (2) - [`6aac9a1`](https://github.com/morluto/rea/commit/6aac9a16ca3b6a58a340387145190e0593e68bc3) feat(companions): prototype inactive checked-text loading contract - [`cd99f62`](https://github.com/morluto/rea/commit/cd99f62ae20c96203df466c14bf66edf929e2ec8) fix(companions): refuse malformed migration state records ### 📊 Changes **6 files changed** (+736 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `docs/specs/4718-companion-loading-prototype/LICENSE.fixture` (+23 -0) ➕ `docs/specs/4718-companion-loading-prototype/README.md` (+150 -0) ➕ `docs/specs/4718-companion-loading-prototype/legacy-block.fixture.md` (+29 -0) ➕ `docs/specs/4718-companion-loading-prototype/migration.mjs` (+40 -0) ➕ `docs/specs/4718-companion-loading-prototype/prototype.test.mjs` (+249 -0) ➕ `docs/specs/4718-companion-loading-prototype/resolver.mjs` (+245 -0) </details> ### 📄 Description ## Summary I propose an inactive, dependency-free checked-text loading experiment for the contract in #4970, related to #4718. This separate draft provides code and isolated fixtures for discussion; it does not integrate companion loading. ## Problem and expected behavior A companion block changes REA's canonical skill bytes. The experiment instead returns checked text from an exact, explicitly selected local grant. Automatic loading remains inactive because the trusted host/profile and fresh-session delivery prerequisites are unresolved. ## Change and scope Six files under `docs/specs/4718-companion-loading-prototype/`: - Bounded, read-only manual resolver with closed versioned schemas, exact content identity, per-selection grants and checked-buffer provenance. - Value-only registration/disable approval plans and separate health facts. - Exact marked-block removal planning against current fixture bytes, preserving all surrounding/state bytes and transferring no consent. - Candidate routing text, an attributed legacy fixture and 29 Node tests. The [fail-closed integration rule](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#fail-closed-integration) applies. Loader choice, trusted profile/registry/executable binding and installation ownership remain pending maintainer decisions. There is no active canonical skill edit, CLI/MCP command, host adapter, persistence API, setup/update/doctor wiring or production migration writer. This directory is excluded from the npm file list. ## Contract and boundary impact - Semantic owner: experimental manual resolver and value transforms; production ownership remains a design decision. - Scope decision: pending; exploratory draft only, no integration. - CLI/MCP/tool catalog, providers and target formats: unchanged. - Provenance: checked text identifies selected ID, manifest digest, base directory and inventoried path. Manual selection is not host identity proof. - Effects: resolver reads explicitly selected local files; tests create and remove their own temporary fixtures, including hard links/junctions. No package helpers execute. No network, repair, installed-skill/config writes, target execution, injection or protection recovery is implemented. - Package/generated metadata: unchanged; the prototype is outside `package.json#files`. Expected effects: - [x] Read existing files or captured data. - [x] Change files in isolated test fixtures only. ## Evidence and regression coverage Executed on Windows with Node 24.21.0 (repository toolchain pin: 24.18.0): - `node --test docs/specs/4718-companion-loading-prototype/prototype.test.mjs` — final 29/29 passed outside the sandbox, including exact selection/consent, disabled/irrelevant behavior, schema/path/content failures, hard links/junctions, partial package updates and fixture migration. - Original sandbox run: 28/29; fixture creation failed with EPERM on a hard link. The same suite passed outside the sandbox. That was an environment retry, not a product fix. - `node --check` for all three modules — passed. - `git diff --cached --check` — passed. - `npm run check` and `npm run docs:check` — both stopped at the dependency guard because this checkout has no installed locked dependencies. No dependency installation was authorized or performed. - `npm pack --dry-run --ignore-scripts --offline --json` — zero prototype entries in the unbuilt checkout's file list. This is exclusion evidence only, not a package build or setup verification. Full static/docs/source/packaging/test-discovery gates remain unverified. Prototype tests are explicitly invoked outside normal Vitest roots; CI does not implicitly certify them. ## Compatibility, safety, and release Canonical-byte checks and the companion repository are unchanged. Migration is a pure plan over a named fixture state, not conversion of the released updater schema. Production interrupted-write/readback/rollback and actual host delivery are unverified. File snapshots detect observed changes but do not establish an atomic multi-file snapshot, same-user tamper isolation or complete platform reparse protection. Inventory completeness and released companion size fit are not established. Before integration: maintainer contract decision; one genuine pinned fresh-session adapter proof; typed shared contracts and owned filesystem/persistence integration; actual setup/update/doctor and companion migration coverage; applicable full checks and substantive non-author review. No merge, release or installed configuration mutation is requested by this draft. ## Author readiness Human owner: @ShadowSwaps - [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 - [ ] Material scope, authority and required maintainer decisions cover the final diff. - [ ] Required validation and real-host proof gaps are resolved. - [ ] Substantive non-author review and human readiness are complete. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7311
No description provided.