refactor(agent): Phase 0+1 of the agent/ relocation into TinyAgents - #5249
Draft
senamakel wants to merge 4 commits into
Draft
refactor(agent): Phase 0+1 of the agent/ relocation into TinyAgents#5249senamakel wants to merge 4 commits into
senamakel wants to merge 4 commits into
Conversation
…ntion Renames plan-agents.md to 2026-07-28-agent-runtime-into-tinyagents-design.md, which is the name the transcript design doc already links to, so both specs now cross-reference each other by a resolving relative path. Corrects every count in the plan against the tree as of 2026-07-28: outbound domains 45 -> 48, inbound domains 48 -> 50, the Phase 4 exit figure ~2,000 -> 547, the 20-25k 'stays host-side' estimate -> a measured 22,121 LOC, and eight per-domain reference counts. Records Phases 0 and 1 complete and Phases 2-7 deliberately not executed.
…ision Adds rows AR-1..AR-4 to the TinyAgents drift ledger in its existing '# | Area | Status | Evidence / action' schema, and annotates the 'agent/ remainder - STAYS' verdict in the migration plan's section 7 as REOPENED (narrowed, not reversed).
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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
agent/→ TinyAgents relocation program. No hostsrc/change; docs, ledger, lockfiles, and the vendored gitlink.docs/specs/convention, and corrects the plan's ground-truth numbers, which were re-derived from the tree and found substantially wrong.tinyagentsto 2.1.1, which lands ten host-capability seams with inert defaults — feat(harness): add host capability seams with inert defaults tinyagents#83. Nothing in the host calls them yet.Problem
The plan relocates
src/openhuman/agent/(152 files, 70,530 LOC) into the vendored crate, inverting ~48 outbound domain dependencies into ~10 capability traits. It is explicitly a multi-quarter program with stop-anywhere phase boundaries.Phase 0 gates everything after it: "Nothing moves until the trait catalogue is accepted upstream — otherwise the first mover defines the seams by accident." This PR is that gate, and nothing beyond it.
Separately, the plan's own figures could not be reproduced. Since later phases are scoped and measured against them, they had to be corrected before any code moves.
Solution
Phase 0 — trait catalogue filed upstream as
docs/spec/host-capabilities-spec.md(#83); ledger rows AR-1 … AR-4 reopened; both specs filed underYYYY-MM-DD-<slug>-design.mdand their previously-dangling cross-references reconciled.Phase 1 — ten traits + inert defaults land in the crate. Version 2.1.0 → 2.1.1, a deliberate patch: the host pins
^2.1, so a minor bump would force aCargo.tomledit Phase 1 forbids.Ground-truth corrections (every figure re-derived; methodology recorded in the plan's header):
crate::openhuman::inharness/session/agent::harness::*inbound refsagent::triage/agent::busagent/size;configrefs; LOC that staysThe Phase 4 metric was overstated ~3.7×: the entire
agent/tree contains only 1,287 such references, so no scoping reproduces ~2,000. §2.3 also had its outbound/inbound labels swapped. Inbound counts are consistently higher than stated, so the risk §6 already calls "the real cost" is larger than the plan assumed.Unresolved — needs a decision before Phase 4
All ten traits are generic over
State, per the plan's §1 premise that "Stateis the injection vehicle." The evidence cuts against it. Only 7 of the crate's 18 extension traits carryState, and all 7 are execution traits; the 11 genuine capability traits are barepub trait X: Send + Sync. AndStateis currently dead weight here —AgentHarnessstores none, every host construction isAgentHarness<()>, and all ~30 host impls are<()>. Adopting a non-unitStateis a signature change across all of them that §2.3's cost section does not account for. Discussion is on #83.Submission Checklist
N/A: docs, ledger, lockfile and gitlink only — no host source changed.Test coverage for the new crate surface is in Docs: issue/PR templates, CLAUDE workflow notes, PR template filename #83 (37 tests over the default impls, plus ahost_seam_hygieneboundary test).N/A: no host source lines changed; diff is Markdown, lockfiles, and a submodule pointer.N/A: no feature added, removed or renamed.## Related—N/A: no feature rows affected.N/A: no release-cut surface touched.Closes #NNN—N/A: no tracking issue; this executes a spec in-repo.Impact
Runtime: none. No host code path changes. The crate bump is additive — the ten traits have no caller in either repo, so behavior is byte-identical.
Verified green in both Cargo worlds, including the slim build (a genuine fresh compile, not a cache hit):
Migration/compatibility: none in this PR. The on-disk risk lives in Phase 2, which rewrites the
session_rawtranscript format on live installs and is deliberately sequenced first and alone. Both specs require a shadow-read parity soak with mismatches logged and never panicked, plus coverage of the legacyDDMMYYYY/andread_transcript_legacy_mdpaths.Lockfiles carry the 2.1.0 → 2.1.1 bump plus pre-existing repair cargo performs on any resolve here: a
reqwest 0.12.28→reqwestdisambiguator normalization (reproduced with the crate version held at 2.1.0), and atinyhumans-sdkentry missing from the committedapp/src-tauri/Cargo.lock(git show HEAD:app/src-tauri/Cargo.lock | grep -c tinyhumans-sdk→ 0). Neither is caused by this change.Related
N/Adocs/specs/2026-07-28-agent-runtime-into-tinyagents-design.md. Phase 2 (transcript format) carries the program's only user-visible data risk.AI Authored PR Metadata
Linear Issue
N/AN/ACommit & Branch
agent-to-tinyagents5ffcbfd07Validation Run
pnpm --filter openhuman-app format:check—N/A: no frontend file changed.pnpm typecheck—N/A: no TypeScript changed.cargo test --all-featuresinvendor/tinyagents→ 0 failures across every target.cargo fmt --checkclean;cargo checkgreen on the root crate, full and slim feature sets.cargo check --manifest-path app/src-tauri/Cargo.tomlgreen.Validation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
tests/host_seam_hygiene.rsscans the new module for embedder-specific vocabulary (openhuman,composio,action_dir,SOUL.md, …) and fails with file, line, and reason — enforcing the GPL/crates.io publishability boundary as a test rather than a convention.Duplicate / Superseded PR Handling