build(exports): register ./analyst-loop subpath#351
Conversation
runAnalystLoop is exported from src/analyst-loop/index.ts and the self-improving-loop example documents importing it from @tangle-network/agent-runtime/analyst-loop, but the subpath was absent from package.json exports + the tsup entry list, so it did not resolve in a published install. Add the tsup entry + exports map entry; build emits dist/analyst-loop.{js,d.ts}.
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved PR — 1dd50d9c
Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-21T14:33:00Z
tangletools
left a comment
There was a problem hiding this comment.
🟡 Value Audit — sound-with-nits
| Verdict | sound-with-nits |
| Concerns | 2 (2 weak-concern) |
| Heuristic | 0.0s |
| Duplication | 0.0s |
| Interrogation | 108.5s (2 bridge agents) |
| Total | 108.5s |
💰 Value — sound
Fixes a package export omission: the documented public subpath @tangle-network/agent-runtime/analyst-loop now actually resolves by adding the matching tsup entry and package.json exports block.
- What it does: Adds
'analyst-loop': 'src/analyst-loop/index.ts'totsup.config.tsentry map (tsup.config.ts:9) and registers a./analyst-loopexports block inpackage.jsonpointing todist/analyst-loop.{js,d.ts}(package.json:37-41). This causes the build to emitdist/analyst-loop.js+.d.tsand makes the subpath importable from a published install. - Goals it achieves: Closes the gap between the public API surface already advertised in
README.md:236andexamples/self-improving-loop/self-improving-loop.ts:124and the actual published package, so consumers can importrunAnalystLoopand its types from@tangle-network/agent-runtime/analyst-loopwithoutERR_PACKAGE_PATH_NOT_EXPORTED. - Assessment: Good. The change is minimal, follows the exact same
types/import/defaultshape already used by./loops,./profiles, and./mcp(package.json:22-51), and only repairs an existing documented subpath rather than inventing a new one. It matches the source layout (src/analyst-loop/index.ts) and the existingtsupentry naming convention. - Better / existing approach: none — this is the right approach. The codebase already uses this subpath export pattern for every public module; there is no existing
./analyst-loopexport to reuse. I checkedpackage.json,tsup.config.ts,src/analyst-loop/index.ts,README.md:236, andexamples/self-improving-loop/self-improving-loop.ts:124.docs/simplification-plan.md:91mentions a future intent to internalize `anal - Model: opencode/kimi-for-coding/k2p7
- Bridge attempts: 1
🎯 Usefulness — sound-with-nits
Correct bug fix — wires a documented-but-unresolvable public subpath into tsup + exports so the analyst loop is actually consumable from a published install.
- Integration: Reachable and used. Source exists at src/analyst-loop/index.ts:12 exporting runAnalystLoop. Internal caller at src/loop-runner.ts:29 uses a relative path (works regardless). External/docs callers depend on the public subpath: examples/self-improving-loop/README.md:107 documents
@tangle-network/agent-runtime/analyst-looprunAnalystLoopas the production analyst substrate; README.md:236 referenc - Fit with existing patterns: Follows the established pattern exactly. Every other tsup entry (agent, intelligence, loops, profiles, mcp) has a matching block in package.json exports; analyst-loop was the lone gap. Block shape (types/import/default) matches the neighboring ./loops block at package.json:32-36 verbatim. No competing pattern.
- Real-world viability: Pure config wiring — no runtime behavior change, no concurrency surface, no error paths introduced. Holds up because the only thing it does is make the existing built module resolvable; the dist files already build. PR body's import smoke test is the right verification.
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 1
🎯 Usefulness Audit
🟡 Tension with simplification-plan's INTERNALIZE direction [problem-fit] ``
docs/simplification-plan.md:91 and :106 explicitly list
./analyst-loop(and the 4-file module) as INTERNALIZE — 'analyze is internal (auto-on-settle)'. That plan is unimplemented and the current docs/README/examples treat the subpath as public, so this PR matches present intent — but a human may want to decide whether exposing it more firmly as public (vs. just fixing the gap quietly) is consistent with where the codebase is heading. Not a blocker.
🟡 Not added to verify-package-exports.mjs regression guard [robustness] ``
scripts/verify-package-exports.mjs:29-36 enumerates requiredExports (., ./agent, ./intelligence, ./loops, ./profiles, ./mcp) and asserts each resolves in a packed tarball — but not ./analyst-loop. The very gap this PR fixes would have been caught by that script had the subpath been listed. Adding
'./analyst-loop': ['import', 'types']would prevent the same regression later. Small, optional improvement.
What this audit checks
It judges the change on its merits — not whether it was tasked out in an issue. Unticketed, fast-moving work is fine; the question is whether the change is good and whether a better or existing approach should be used instead.
| Pass | What it asks |
|---|---|
| Heuristic | Vague title? Whitespace-only or cruft-bearing diff? (content signals only) |
| Duplication | Do added function/class names already exist elsewhere in the repo? |
| Value Audit | What does it do? What goal does it achieve? Is it good? Better architecture or already-exists? |
| Usefulness Audit | Does it integrate and fit? Will it hold up in real use and actually get used? |
Findings are concerns, not blocks — the human reviewer decides what to do with them.
✅ No Blockers —
|
| deepseek | glm | aggregate | |
|---|---|---|---|
| Readiness | 85 | 92 | 85 |
| Confidence | 70 | 70 | 70 |
| Correctness | 85 | 92 | 85 |
| Security | 85 | 92 | 85 |
| Testing | 85 | 92 | 85 |
| Architecture | 85 | 92 | 85 |
Full multi-shot audit completed 2/2 planned shots over 2 changed files. Global verifier still owns final merge decision. | Full multi-shot audit completed 2/2 planned shots over 2 changed files. Global verifier still owns final merge decision.
🟡 LOW verify-package-exports gate does not cover the new ./analyst-loop export — package.json
scripts/verify-package-exports.mjs:29-36 enumerates requiredExports for
.,./agent,./intelligence,./loops,./profiles,./mcpbut not the newly added./analyst-loop(package.json:37-41). Impact: if a future change drops the tsup entry or the export target, the pack/import smoke test will not catch it for this subpath. Fix: add'./analyst-loop': ['import', 'types']to the requiredExports map in scripts/verify-package-exports.mjs. Note: that file is outside this shot's scope, so this is a recommendation for the PR author, not a blocking issue for package.json itself.
tangletools · 2026-06-21T14:40:00Z · trace
…oser-rename drift Adds src/analyst-loop/index.ts to typedoc entryPoints so the new ./analyst-loop subpath generates an API page and its symbols are gated. Regenerates docs/api and refreshes docs/canonical-api.md (version 0.69.0->0.70.0, agent-eval pin >=0.93->>=0.95, gepaDriver->gepaProposer) — pre-existing drift from the 0.70.0 Proposer-rename release that left the docs gate red on main.
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved PR — 9c5d68c6
Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-21T14:41:21Z
runAnalystLoopis exported fromsrc/analyst-loop/index.ts, and theexamples/self-improving-loopREADME + code document importing it from@tangle-network/agent-runtime/analyst-loopas the production analyst path. But that subpath was missing frompackage.jsonexportsand thetsupentry list, so it does not resolve in a published install —import { runAnalystLoop } from '@tangle-network/agent-runtime/analyst-loop'throwsERR_PACKAGE_PATH_NOT_EXPORTED.Change
'analyst-loop': 'src/analyst-loop/index.ts'to the tsup entry map../analyst-loopblock topackage.jsonexports.Verified
Clean
pnpm install(agent-eval 0.95.0) +pnpm build: ESM + DTS build success, emitsdist/analyst-loop.jsanddist/analyst-loop.d.ts(2.83 KB).import('./dist/analyst-loop.js')→runAnalystLoopis a function.Surfaced while re-auditing the substrate-adoption skills, which cite this subpath.