feat(persona-kit): add side-effect-free ./spec validation entrypoint - #237
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
📝 WalkthroughWalkthroughAdds a new Changespersona-kit
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The package barrel (index.js) re-exports the orchestration modules (mount, execute, plan, skills, skill-runner, config-files), so importing it to validate a persona/agent spec EVALUATES every one of those modules' top-level code — node:child_process, node:fs, and the deferred @relayfile/local-mount -> @parcel/watcher edge — none of which a pure validation consumer needs. Add `@agentworkforce/persona-kit/spec`: a narrow entrypoint that re-exports only the parsers, type guards, constants, and spec types from parse.ts / constants.ts / types.ts. The emitted dist/spec.js has ZERO external (non-relative) imports, so server-side validation consumers (e.g. AgentWorkforce Cloud's @cloud/core persona-spec wrapper) can pull in the validation surface without dragging in any native binding or orchestration dependency. Additive export only (the `.` barrel is unchanged); versioning is left to CI. Includes spec entrypoint tests. https://claude.ai/code/session_01CsCeMqBz8roJSvgpJeqCt7
b0a557e to
71cd348
Compare
Companion to AgentWorkforce/cloud#2194 (cloud issue #2192).
Why
The package barrel (
index.ts) re-exports the orchestration modules —mount,execute,plan,skills,skill-runner,config-files,interactive-spec, … — so importing it just to validate a persona/agent spec EVALUATES every one of those modules' top-level code:node:child_process,node:fs, and the deferred@relayfile/local-mount → @parcel/watcheredge. None of that is needed by a pure validation consumer such as AgentWorkforce Cloud's deploy route (which centralizes persona-kit behind@cloud/corein the companion PR).What
@agentworkforce/persona-kit/spec— a narrow entrypoint (src/spec.ts) that re-exports only the parsers, type guards, constants, and spec types fromparse.ts/constants.ts/types.ts.dist/spec.jslikewise has no external requires — no@relayfile/*, no native bindings, no Node process/fs APIs at module-eval time. Verified against the build output..barrel is unchanged. Versioning is left to CI (no manualversionbump in this PR).src/spec.test.tscovering the re-exported validation surface (incl. the grok harness).Tests
pnpm --filter @agentworkforce/persona-kit typecheck: clean.pnpm --filter @agentworkforce/persona-kit test: 281/281 pass (4 new spec-entrypoint tests).Follow-up
Once a version carrying
./specis published,@cloud/core/proactive-runtime/persona-spec.tscan switch its import from the barrel@agentworkforce/persona-kitto@agentworkforce/persona-kit/spec, eliminating orchestration-module evaluation from the Cloud validation path entirely.https://claude.ai/code/session_01CsCeMqBz8roJSvgpJeqCt7