feat(spec-2): deep armory integration (memory + vision, fleet-owned) - #2
Merged
Merged
Conversation
…ision, fleet-owned) SPEC-2 completes the child-side moat: memory-hydrated + vision-capable subagents by deliberate fleet construction (ports-and-adapters), not accidental inheritance. - CustomResourceLoader: noExtensions:true + composed systemPromptOverride + excludeTools:[todo] + conditional customTools (describe_image, text-only) - MemoryHydratePort/Adapter: three-scope (project/local/user) hydration over armory-memory's cwd-keyed primitive; companion PR (exports + .d.ts) - VisionPort/Adapter: capability-aware on child's model; reuse host vision.json; companion PR to vision (exports + .d.ts) - Frontmatter: memoryHydrate + vision (bool, default true), cursor deferred to SPEC-5b - Agents-view: armory chip + i:Info detail pane - 5-row real-pi smoke matrix (moat-delivered + no-leak negative-space proof) - Reconciles PRD §8 'cursor editor in child sessions' (category error -> SPEC-5b)
…eet-owned) Companion PRs (armory-memory + vision exports) -> MemoryHydratePort/VisionPort + adapters -> fleet describe_image tool -> CustomResourceLoader builder -> frontmatter fields -> spawnSubagent threading -> index wiring -> builtin -> panel armory chip + Info -> real-pi smoke matrix -> CI gate. TDD per task; two impl-verification steps (ModelRegistry mapping, ToolDefinition execute shape) flagged with exact source files to check.
…dration) Adds @getpipher/armory-memory + @getpipher/vision as file: deps (companion exports-surface PRs #2 + #15 expose the typed surfaces fleet consumes). MemoryHydratePort (fleet-owned) + ArmoryMemoryAdapter (sole armory-memory importer). renderScopes composes three renderMemoryBlock calls (project → local → user) over armory-memory's cwd-keyed primitive; empty scopes dropped cleanly via listMemory length check.
…gation) VisionPort (fleet-owned) + ArmoryVisionAdapter (sole @getpipher/vision importer). Adapter takes a ModelRegistry slice (fleet constructs new ModelRegistry(modelRuntime) in Task 9) + cwd + agentDir, wraps vision's createVisionDelegator. isMultimodal delegates to vision; isConfigured reflects vision.json; delegate() maps DelegateResult → VisionDelegateResult with an actionable 'no vision model configured' error when unconfigured.
A fleet-defined describe_image tool for child sessions — mirrors vision's contract (image path + optional prompt) but execute() delegates via VisionPort. Vision's extension never loads into the child; fleet owns this tool. Returns text on success, actionable isError on failure/unconfigured.
…t true) Adds memoryHydrate + vision to AgentDef (default true, consistent with todoSync). Updates 3 SPEC-1 test fixtures that construct AgentDef literals.
…rompt) buildChildLoader constructs a DefaultResourceLoader with noExtensions:true (suppress host extensions → deterministic child, no leakage), composed systemPromptOverride (rolePrompt + memoryBlock + base, fixes SPEC-1's replace-everything), scoped skillsOverride. composeChildPrompt + USER_PSEUDO_CWD + memoryScopesFor are pure/unit-tested.
…rop todo-filter SpawnOptions gains optional memoryPort + visionPort (no-op defaults so SPEC-1 tests omit them unchanged); ChildSessionOpts gains required agent + memoryPort + visionPort (threaded to the factory). The todo-filter is removed — tools pass through unfiltered; the child factory enforces excludeTools:['todo'] downstream (SPEC-2 §9.1 hardening). Updated the 'todo excluded' test to the new contract.
…ChildLoader + excludeTools createChildSessionFactory now takes a shared memoryPort; builds the fleet CustomResourceLoader (noExtensions + composed prompt) via buildChildLoader, constructs a ModelRegistry(modelRuntime) + ArmoryVisionAdapter per-spawn (needs child cwd), and passes excludeTools:['todo'] + conditional customTools (describe_image, text-only child only) to createAgentSession. deps wires ArmoryMemoryAdapter as the shared memoryPort.
agentsRow grows an armory:[t✓ m✓ v✗] chip (todoSync/memoryHydrate/vision per agent). New i:Info action (agents view) opens a read-only detail pane rendering agentInfo — all hooks, model, thinkingLevel, tools, skills, file, role prompt. Escape returns to the list. Updated the SPEC-1 rows tests to the new chip format.
…trix) No-cost smoke (term-verified): extension loads with no crash (no EditorTheme gotcha), /fleet opens, Agents-view armory chip renders, i:Info detail pane renders. Full-run matrix (rows 1-5: inspect child prompt + tools) needs RECTOR's API keys + a throwaway logging hook — flagged pending like SPEC-1's smoke.
…ass through unfiltered)
scripts/spec-2-smoke.mts exercises the real factory components (buildChildLoader +
new ModelRegistry(realRuntime) + createAgentSession({customTools, excludeTools}) +
session.prompt()) — the runtime-unverified integration path from the PR review.
Rows 1-5 all green against Ollama Cloud (glm-5.2:cloud text-only + minimax-m3:cloud
multimodal): describe_image injects only when text-only, 3-scope memory block
composes, no Open-TODOs leak, todo excluded, base+rolePrompt present, real
prompt() completes. Smoke checklist doc updated with STATUS: PASSED.
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.
SPEC-2 completes the child-side moat: every fleet-spawned subagent is memory-hydrated (three-scope) + vision-capable (capability-aware) by deliberate fleet construction (ports-and-adapters), not accidental inheritance — per SPEC-1 §9.1's single-writer discipline.
What
buildChildLoader):noExtensions: true(deterministic child, no host-extension leakage) + composedsystemPromptOverride(rolePrompt + memoryBlock + base — fixes SPEC-1's replace-everything) + scoped skills.renderMemoryBlockcalls.vision.json; fleet-defineddescribe_imagetool injected viacustomToolsonly when text-only (pass-through when multimodal).todo-exclusion viaexcludeTools: ['todo'](replaces SPEC-1's fragile active-set omission).memoryHydrate+vision(bool, defaulttrue), consistent withtodoSync.armory:[t✓ m✓ v✓]chip +i:Infodetail pane.Companion PRs (must merge before release)
exports+index.ts/.d.tsexports+index.ts/.d.ts+createVisionDelegatorVerification
pnpm typecheckclean./fleetopens, armory chip renders,i:Inforenders.docs/SPEC-2-smoke-checklist.md.Release (v0.2.0 tag + dep switch) is RECTOR's co-release call, same as SPEC-1.