feat(0.x): researcherProfile + multiHarnessResearcherFanout (1.3.0)#14
Merged
Conversation
Source-grounded research profile that pairs with @tangle-network/agent- runtime/loops. The profile ships an AgentProfile, prompt formatter, output adapter, and validator; the runtime kernel owns iteration, concurrency, cost, and trace emission. Three invariants the validator enforces: - namespace isolation — cross-tenant items + proposedWrites hard-fail - provenance — every item carries at least one evidence entry - citation density — quotes-with-source / items >= floor (default 0.7) Propose-don't-apply: the profile emits KnowledgeUpdate[] in the output; the caller decides whether to route through applyKnowledgeWriteBlocks / a KbStore put. The profile module imports no FS primitives. New subpath export: @tangle-network/agent-knowledge/profiles. Tests cover validator scoring (good + bad), namespace isolation, propose-without-materialize, loose-output passthrough (raw[] preserves agent extras), and end-to-end runLoop through a stub sandbox.
# Conflicts: # package.json # pnpm-lock.yaml
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
Phase 1.A of the driven-loop substrate push. Ships
researcherProfile()+multiHarnessResearcherFanout()as a new sub-export
@tangle-network/agent-knowledge/profiles. Pairs with@tangle-network/agent-runtime/loops— the profile owns prompt + outputadapter + validator; the runtime kernel owns iteration, concurrency,
cost, abort, and trace emission.
hard-fail), provenance (every item carries >= 1 evidence entry),
citation density floor (default 0.7).
KnowledgeUpdate[]; thecaller decides whether to route them through
applyKnowledgeWriteBlocks/ a KbStore put. The profile moduleimports no FS primitive — enforced by a test that scans the source.
items,citations,proposedWritesare required;gaps,notes, and any agent extras land inrawrather thangetting dropped. Validator scoring:
0.4·citation_density + 0.2·source_diversity + 0.2·recency_match + 0.2·gap_coverage.claude-code, codex.
doc captures the extraction map for a follow-up agent-builder PR.
Substrate audit findings
Full audit:
/tmp/agent-knowledge-audit.md. Summary of the threeprimitives the spec demanded:
KnowledgeFreshnessStoreis per-workspaceId;KbStore+ types are single-tenantKnowledgeClaimhas refs/confidence/status; no top-levelKnowledgeItemwithsupersedes[]/retractedAt/authoredByKnowledgeItemwhose field names match the eventual substrate promotion 1:1.parseKnowledgeWriteBlocks/applyKnowledgeWriteBlocksalready separate proposal from materializeOne PR (not two) because the two PARTIAL primitives don't block the
researcher work — the validator + profile-local types deliver the
spec's invariants today, and the follow-up substrate refactor will
collapse them one-for-one without changing the profile surface.
Test plan
pnpm typecheckclean (strict + noUncheckedIndexedAccess)pnpm buildclean (tsup ESM + DTS, newdist/profiles/entry)pnpm test— 88 passed / 5 skipped (5 skipped are pre-existinglive-HTTP tests; 24 new tests across validator + adapter +
multi-harness + runLoop integration)
biome check src tests— no new warnings (2 pre-existing inunchanged
src/lint.ts+src/wikilinks.ts)manual smoke through dist:
Follow-ups (deferred — out of scope here)
feat/knowledge-primitives— promoteKnowledgeClaim→ top-levelKnowledgeItemsubstrate-wide; addnamespacetoKbStoreget/put;collapse profile-local types.
researcherProfilefromauto-research-runner.ts. Target: drop ~1000 LOC from the 1665-linegod-object. Domain-generic loop pieces move out; persona pool +
lineage + budget + cycle deadline + decideRepairAction stay.