Skip to content

feat(spec-2): deep armory integration (memory + vision, fleet-owned) - #2

Merged
rz1989s merged 14 commits into
mainfrom
feat/spec-2-deep-armory-integration
Jul 24, 2026
Merged

rz1989s merged 14 commits into
mainfrom
feat/spec-2-deep-armory-integration

Conversation

@rz1989s

@rz1989s rz1989s commented Jul 24, 2026

Copy link
Copy Markdown
Member

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

  • CustomResourceLoader (buildChildLoader): noExtensions: true (deterministic child, no host-extension leakage) + composed systemPromptOverride (rolePrompt + memoryBlock + base — fixes SPEC-1's replace-everything) + scoped skills.
  • MemoryHydratePort + ArmoryVisionAdapter: three-scope hydration (project=cwd / local=parent-dir / user=global) over armory-memory's cwd-keyed primitive; fleet composes three renderMemoryBlock calls.
  • VisionPort + ArmoryVisionAdapter: capability-aware on the child's model; reuse host vision.json; fleet-defined describe_image tool injected via customTools only when text-only (pass-through when multimodal).
  • Hardened todo-exclusion via excludeTools: ['todo'] (replaces SPEC-1's fragile active-set omission).
  • Frontmatter: memoryHydrate + vision (bool, default true), consistent with todoSync.
  • Agents-view: armory:[t✓ m✓ v✓] chip + i:Info detail pane.
  • Cursor deferred to SPEC-5b (TUI editor; child is headless — PRD §8 category error reconciled).

Companion PRs (must merge before release)

Verification

  • 65/65 node:test pass; pnpm typecheck clean.
  • No-cost real-pi smoke (term-verified): extension loads (no EditorTheme crash), /fleet opens, armory chip renders, i:Info renders.
  • Full-run smoke matrix (rows 1–5, inspect child prompt + tools) flagged pending RECTOR's API keys — see docs/SPEC-2-smoke-checklist.md.

Release (v0.2.0 tag + dep switch) is RECTOR's co-release call, same as SPEC-1.

rz1989s added 14 commits July 24, 2026 11:18
…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.
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.
@rz1989s
rz1989s merged commit c6e727c into main Jul 24, 2026
1 check failed
@rz1989s
rz1989s deleted the feat/spec-2-deep-armory-integration branch July 24, 2026 07:06
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