naive-framework 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +62 -0
- package/LICENSE +21 -0
- package/README.md +37 -2
- package/docs/decisions/decisions.json +888 -0
- package/docs/ontology.json +796 -0
- package/docs/ontology.md +163 -0
- package/docs/reference/ROUTES.md +124 -0
- package/evidence/benchmarks/2026-10-27-golden.jev.after-catalog-fix.json +558 -0
- package/evidence/benchmarks/2026-10-27-golden.jev.json +501 -0
- package/evidence/benchmarks/2026-10-27-golden.reasoning-answers.json +177 -0
- package/evidence/benchmarks/JEV_VS_REASONING_MODEL_2026-10-27.md +68 -0
- package/evidence/capabilities/agent-capabilities.json +86 -0
- package/evidence/design-documents.registry.json +2896 -0
- package/evidence/evals/evals.json +25 -0
- package/evidence/evals/harness-evals.json +140 -0
- package/evidence/layer.json +51 -0
- package/evidence/skills/agent-capabilities/SKILL.md +35 -0
- package/evidence/skills/design-coverage/SKILL.md +57 -0
- package/evidence/skills/design-coverage/check.mjs +192 -0
- package/evidence/skills/design-coverage/scan.mjs +45 -0
- package/evidence/skills/fidelity-ladder-audit/SKILL.md +121 -0
- package/evidence/skills/fidelity-ladder-audit/ladder-census.mjs +180 -0
- package/evidence/skills/findability/SKILL.md +32 -0
- package/evidence/skills/findability/inventory.rb +41 -0
- package/evidence/skills/foreshadowing-audit/SKILL.md +183 -0
- package/evidence/skills/metrics-review/SKILL.md +177 -0
- package/evidence/tooling/integrations.json +153 -0
- package/governance/layer.json +102 -0
- package/governance/references/references.json +26 -0
- package/governance/skills/board-design/SKILL.md +68 -0
- package/governance/skills/brand-pillar/SKILL.md +90 -0
- package/governance/skills/business-pillar/SKILL.md +96 -0
- package/governance/skills/chief-of-staff/SKILL.md +45 -0
- package/governance/skills/cofounder-structure/SKILL.md +64 -0
- package/governance/skills/cross-pillar-tradeoff/SKILL.md +168 -0
- package/governance/skills/equity-and-share-classes/SKILL.md +68 -0
- package/governance/skills/executive-roles/SKILL.md +95 -0
- package/governance/skills/exit-planning/SKILL.md +66 -0
- package/governance/skills/financing-and-investor-rights/SKILL.md +73 -0
- package/governance/skills/office-hours-mode/SKILL.md +113 -0
- package/governance/skills/product-pillar/SKILL.md +81 -0
- package/governance/skills/publication-policy/SKILL.md +63 -0
- package/governance/skills/role-and-candidate-authoring/SKILL.md +198 -0
- package/governance/skills/stakeholder-update/SKILL.md +177 -0
- package/governance/tooling/integrations.json +37 -0
- package/governance/venture-template/AGENT_ROLES_AND_DECISION_RIGHTS.md +58 -0
- package/governance/venture-template/COMPANY_VAULT_DEFINITION_2026-10-25.md +204 -0
- package/governance/venture-template/README.md +74 -0
- package/governance/venture-template/decision-rights.json +186 -0
- package/governance/venture-template/index.md +151 -0
- package/governance/venture-template/pillars/brand.md +209 -0
- package/governance/venture-template/pillars/business.md +255 -0
- package/governance/venture-template/pillars/product.md +254 -0
- package/governance/venture-template/render-roles.py +11 -0
- package/governance/venture-template/roles/README.md +85 -0
- package/governance/venture-template/roles/agent-roles.json +202 -0
- package/governance/venture-template/roles/ceo.md +163 -0
- package/governance/venture-template/roles/chief-of-staff.md +153 -0
- package/governance/venture-template/roles/cmo.md +165 -0
- package/governance/venture-template/roles/coo.md +189 -0
- package/governance/venture-template/roles/cto.md +158 -0
- package/governance/venture-template/roles/department-head.md +47 -0
- package/governance/venture-template/roles/forward-deployed-engineer.md +51 -0
- package/governance/venture-template/roles/founder.md +173 -0
- package/governance/venture-template/roles/hr-manager.md +49 -0
- package/governance/venture-template/roles/talent-acquisition-manager.md +50 -0
- package/governance/venture-template/roles/venture-roles.json +62 -0
- package/interface/acting.mjs +83 -0
- package/interface/adapters/claude-code.json +16 -0
- package/interface/adapters/codex.json +14 -0
- package/interface/adapters/cursor.json +16 -0
- package/interface/adapters.mjs +182 -0
- package/interface/api/server.mjs +71 -0
- package/interface/boundaries.mjs +218 -0
- package/interface/brand.mjs +214 -0
- package/interface/cli/find-venture.mjs +15 -0
- package/interface/cli/freshness.mjs +59 -0
- package/interface/cli/guard.mjs +6 -0
- package/interface/cli/mentura.mjs +341 -0
- package/interface/cli/naive.mjs +194 -0
- package/interface/context.mjs +524 -0
- package/interface/demo/board.mjs +581 -0
- package/interface/demo/decision-harness.mjs +91 -0
- package/interface/demo/live-agent.mjs +47 -0
- package/interface/dev/setup.mjs +84 -0
- package/interface/gate-hooks.mjs +36 -0
- package/interface/harness/evals.mjs +90 -0
- package/interface/harness/examples/pt-no-shows.dump.md +19 -0
- package/interface/harness/run.mjs +313 -0
- package/interface/harness/site.mjs +59 -0
- package/interface/instrumentation.mjs +86 -0
- package/interface/kit-boundary.mjs +73 -0
- package/interface/layer.json +37 -0
- package/interface/mcp/server.mjs +162 -0
- package/interface/operator-console/README.md +58 -0
- package/interface/package-routes.mjs +196 -0
- package/interface/provenance.mjs +65 -0
- package/interface/reads.mjs +173 -0
- package/interface/references/references.json +28 -0
- package/interface/release-card.mjs +42 -0
- package/interface/route-aliases.json +32 -0
- package/interface/router.mjs +653 -0
- package/interface/skills/install-mentura/SKILL.md +88 -0
- package/interface/skills/naive-setup/SKILL.md +71 -0
- package/interface/skills/naive-setup/artifact.html +83 -0
- package/interface/tooling/integrations.json +112 -0
- package/interface/vitals.mjs +115 -0
- package/interface/writes.mjs +190 -0
- package/knowledge/connectors/README.md +54 -0
- package/knowledge/connectors/catalog.mjs +118 -0
- package/knowledge/connectors/contract.mjs +56 -0
- package/knowledge/connectors/eval.mjs +176 -0
- package/knowledge/connectors/filesystem.mjs +79 -0
- package/knowledge/connectors/index.mjs +102 -0
- package/knowledge/connectors/resolve.mjs +44 -0
- package/knowledge/connectors/suite.mjs +80 -0
- package/knowledge/freshness.json +85 -0
- package/knowledge/layer.json +50 -0
- package/knowledge/skills/find-reference/SKILL.md +38 -0
- package/knowledge/skills/industry-awareness/SKILL.md +277 -0
- package/knowledge/templates/glossary.md +23 -0
- package/knowledge/tooling/integrations.json +127 -0
- package/knowledge/tooling/questions.md +46 -0
- package/operations/FOUNDER_OPERATING_MODEL_CAMPAIGN_2026-10-14.md +16 -0
- package/operations/departments.json +162 -0
- package/operations/handoff-v2.md +93 -0
- package/operations/layer.json +67 -0
- package/operations/marketing/check-public.mjs +68 -0
- package/operations/marketing/site/README.md +86 -0
- package/operations/marketing/site/matrix.json +731 -0
- package/operations/marketing/site/plan.mjs +117 -0
- package/operations/marketing/site/presence.mjs +252 -0
- package/operations/references/references.json +45 -0
- package/operations/skills/recruiting/SKILL.md +32 -0
- package/operations/skills/team-design/SKILL.md +36 -0
- package/operations/skills/tool-selection/SKILL.md +46 -0
- package/operations/templates/marketing-brand.md +46 -0
- package/operations/templates/public-assets.md +39 -0
- package/operations/templates/recruiting-brief.md +35 -0
- package/operations/tooling/integrations.json +158 -0
- package/package.json +59 -4
- package/packages/catalog.json +280 -0
- package/packages/cofounder/package.json +42 -0
- package/packages/counsel/package.json +47 -0
- package/packages/customers/package.json +41 -0
- package/packages/deals/package.json +27 -0
- package/packages/decisions/package.json +28 -0
- package/packages/engineering/package.json +41 -0
- package/packages/evidence/package.json +17 -0
- package/packages/finance/frames/fund-without-ceding-control.frame.json +177 -0
- package/packages/finance/package.json +48 -0
- package/packages/foundation/package.json +59 -0
- package/packages/fund/package.json +48 -0
- package/packages/investor/package.json +57 -0
- package/packages/investors/package.json +21 -0
- package/packages/legal/package.json +73 -0
- package/packages/marketing/package.json +63 -0
- package/packages/money/package.json +42 -0
- package/packages/operations/package.json +74 -0
- package/packages/partner/package.json +38 -0
- package/packages/people/package.json +64 -0
- package/packages/product/package.json +49 -0
- package/packages/raw/package.json +19 -0
- package/packages/relationships/package.json +52 -0
- package/packages/validation/package.json +112 -0
- package/platform/README.md +51 -0
- package/platform/adapter.json +15 -0
- package/platform/connectors/eval.mjs +154 -0
- package/platform/connectors/fake-github.mjs +91 -0
- package/platform/connectors/github.mjs +105 -0
- package/platform/integrations/jev.mjs +30 -0
- package/platform/integrations/langsmith-docket.mjs +53 -0
- package/platform/integrations/langsmith-setup.mjs +115 -0
- package/platform/integrations/langsmith.mjs +47 -0
- package/platform/integrations/remote-image.mjs +79 -0
- package/platform/integrations/rho.mjs +146 -0
- package/platform/integrations/site.mjs +75 -0
- package/platform/kits/README.md +14 -0
- package/platform/kits/agent-upgrade/kit.json +15 -0
- package/platform/kits/agent-upgrade/run.mjs +82 -0
- package/platform/kits/agent-upgrade/stand-in-agent.mjs +32 -0
- package/platform/kits/validation-kickoff/kit.json +29 -0
- package/platform/mcp/research.mjs +64 -0
- package/platform/webhooks/server.mjs +70 -0
- package/purpose/checklists/vault-and-tooling-consultancy-setup.md +216 -0
- package/purpose/frameworks/business-discovery-framework-amendments-2026-05-20.md +181 -0
- package/purpose/frameworks/business-discovery-framework.html +938 -0
- package/purpose/frameworks/business-discovery-framework.md +326 -0
- package/purpose/frameworks/idea-map/README.md +74 -0
- package/purpose/frameworks/idea-map/conventions.json +146 -0
- package/purpose/frameworks/idea-map/graph.mjs +182 -0
- package/purpose/frameworks/idea-map/ideamap.mjs +181 -0
- package/purpose/frameworks/idea-map/route.mjs +140 -0
- package/purpose/frameworks/onboarding-handoff-framework.md +269 -0
- package/purpose/frameworks/post-discovery-deliverable-playbook.md +274 -0
- package/purpose/frameworks/product-anatomy/README.md +63 -0
- package/purpose/frameworks/product-anatomy/anatomy.mjs +195 -0
- package/purpose/frameworks/product-anatomy/examples/polity.answers.reasoned.json +11 -0
- package/purpose/frameworks/product-anatomy/examples/polity.json +89 -0
- package/purpose/frameworks/product-anatomy/phases.json +107 -0
- package/purpose/frameworks/product-anatomy/questions.json +74 -0
- package/purpose/kits/validation/README.md +14 -0
- package/purpose/kits/validation/references/references.json +122 -0
- package/purpose/kits/validation/skills/problem-validation/SKILL.md +43 -0
- package/purpose/kits/validation/skills/validation-score/SKILL.md +35 -0
- package/purpose/kits/validation/templates/go-to-market.md +19 -0
- package/purpose/kits/validation/templates/operations-readiness.md +20 -0
- package/purpose/kits/validation/templates/pricing.md +22 -0
- package/purpose/kits/validation/templates/problem-interview.md +36 -0
- package/purpose/kits/validation/templates/problem.md +45 -0
- package/purpose/kits/validation/templates/product-market-fit.md +23 -0
- package/purpose/kits/validation/templates/solution.md +18 -0
- package/purpose/kits/validation/templates/team.md +19 -0
- package/purpose/kits/validation/weights.json +22 -0
- package/purpose/layer.json +53 -0
- package/purpose/references/references.json +324 -0
- package/purpose/skills/ambition-tier/SKILL.md +205 -0
- package/purpose/skills/telos/SKILL.md +52 -0
- package/purpose/strategic-foundation.json +133 -0
- package/purpose/templates/telos-based-smart.md +39 -0
- package/purpose/tooling/integrations.json +48 -0
- package/schema/README.md +62 -0
- package/schema/VERSION +1 -0
- package/schema/access.mjs +57 -0
- package/schema/account.schema.json +79 -0
- package/schema/adapter.schema.json +33 -0
- package/schema/add-department.mjs +41 -0
- package/schema/agent-capability.schema.json +94 -0
- package/schema/alignment.schema.json +61 -0
- package/schema/assess-problem.mjs +131 -0
- package/schema/assets.mjs +212 -0
- package/schema/bdd.mjs +56 -0
- package/schema/board.schema.json +101 -0
- package/schema/brand.mjs +373 -0
- package/schema/build-release.mjs +61 -0
- package/schema/caching.mjs +505 -0
- package/schema/check-assets.mjs +24 -0
- package/schema/check-boundary.mjs +54 -0
- package/schema/check-brand.mjs +24 -0
- package/schema/check-config.mjs +110 -0
- package/schema/check-data-model.mjs +170 -0
- package/schema/check-data-packages.mjs +83 -0
- package/schema/check-departments.mjs +45 -0
- package/schema/check-execution.mjs +85 -0
- package/schema/check-governance.mjs +98 -0
- package/schema/check-integrations.mjs +33 -0
- package/schema/check-nextjs-status.mjs +79 -0
- package/schema/check-nouns.mjs +49 -0
- package/schema/check-people.mjs +70 -0
- package/schema/check-private.mjs +61 -0
- package/schema/check-provenance.mjs +55 -0
- package/schema/check-publication.mjs +96 -0
- package/schema/check-ready.mjs +89 -0
- package/schema/check-sources.mjs +74 -0
- package/schema/check-team.mjs +94 -0
- package/schema/check-telos.mjs +59 -0
- package/schema/check-validation.mjs +165 -0
- package/schema/check-ventures.mjs +81 -0
- package/schema/check-where-used.mjs +58 -0
- package/schema/data-master.schema.json +14 -0
- package/schema/data-model.json +1584 -0
- package/schema/data-model.schema.json +152 -0
- package/schema/deal.schema.json +80 -0
- package/schema/decision-analytics.mjs +77 -0
- package/schema/decision-record.schema.json +290 -0
- package/schema/decision-rights.schema.json +34 -0
- package/schema/decision.schema.json +30 -0
- package/schema/decisions.mjs +327 -0
- package/schema/department-catalog.schema.json +55 -0
- package/schema/department.schema.json +15 -0
- package/schema/departments.mjs +32 -0
- package/schema/docket-eval.mjs +89 -0
- package/schema/docket.mjs +135 -0
- package/schema/eval-suite.schema.json +45 -0
- package/schema/evidence.schema.json +110 -0
- package/schema/examples/frames/judge.mjs +10 -0
- package/schema/examples/migrate/agent.mjs +12 -0
- package/schema/examples/venture-type/jev.mjs +12 -0
- package/schema/examples/workspace/ventures/acme-labs/AGENTS.md +17 -0
- package/schema/examples/workspace/ventures/acme-labs/accounts/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/acme-labs/decisions/discovery-goal.decision.json +23 -0
- package/schema/examples/workspace/ventures/acme-labs/decisions/statement-icp.decision.json +22 -0
- package/schema/examples/workspace/ventures/acme-labs/decisions/statement-problem.decision.json +22 -0
- package/schema/examples/workspace/ventures/acme-labs/decisions/venture.team.decision.json +37 -0
- package/schema/examples/workspace/ventures/acme-labs/knowledge/README.md +3 -0
- package/schema/examples/workspace/ventures/acme-labs/knowledge/sources.json +46 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000001.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000002.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000003.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000004.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000005.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000006.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000007.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000008.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000009.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000010.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000011.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000012.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000013.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000014.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/_streams/transactions/stream.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/money/_summary.json +30 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/customer-service/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/customer-service/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/finance/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/human-capital/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/human-capital/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/it/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/it/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/marketing-and-sales/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/marketing-and-sales/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/products/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/products/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/strategy/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/strategy/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/people/founders/maya-chen.json +15 -0
- package/schema/examples/workspace/ventures/acme-labs/people/people.json +22 -0
- package/schema/examples/workspace/ventures/acme-labs/pillars/brand.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/pillars/business.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/pillars/product.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/products/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/acme-labs/products/decisions/product.core-product.decision.json +28 -0
- package/schema/examples/workspace/ventures/acme-labs/products/decisions/product.exists.decision.json +38 -0
- package/schema/examples/workspace/ventures/acme-labs/products/decisions/product.flagship.decision.json +27 -0
- package/schema/examples/workspace/ventures/acme-labs/profile.md +12 -0
- package/schema/examples/workspace/ventures/acme-labs/provenance.jsonl +12 -0
- package/schema/examples/workspace/ventures/acme-labs/raw/dump.md +6 -0
- package/schema/examples/workspace/ventures/acme-labs/venture.json +27 -0
- package/schema/examples/workspace/ventures/northstar/AGENTS.md +17 -0
- package/schema/examples/workspace/ventures/northstar/accounts/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/northstar/deals/ductline.json +8 -0
- package/schema/examples/workspace/ventures/northstar/deals/kilnworks.json +14 -0
- package/schema/examples/workspace/ventures/northstar/decisions/venture.team.decision.json +31 -0
- package/schema/examples/workspace/ventures/northstar/evidence/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/fund/decisions/terms.decision.json +27 -0
- package/schema/examples/workspace/ventures/northstar/fund/decisions/terms.first-close.decision.json +27 -0
- package/schema/examples/workspace/ventures/northstar/fund/decisions/thesis.decision.json +26 -0
- package/schema/examples/workspace/ventures/northstar/fund/terms.json +22 -0
- package/schema/examples/workspace/ventures/northstar/fund/thesis.json +22 -0
- package/schema/examples/workspace/ventures/northstar/governance/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/external-relationships/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/external-relationships/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/finance/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/human-capital/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/human-capital/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/risk-and-compliance/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/risk-and-compliance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/strategy/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/strategy/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/knowledge/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/operations/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/external-relationships/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/external-relationships/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/finance/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/human-capital/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/human-capital/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/risk-and-compliance/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/risk-and-compliance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/strategy/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/strategy/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/people/founders/ana-ruiz.json +13 -0
- package/schema/examples/workspace/ventures/northstar/people/founders/ben-okafor.json +7 -0
- package/schema/examples/workspace/ventures/northstar/people/people.json +27 -0
- package/schema/examples/workspace/ventures/northstar/pillars/brand.md +5 -0
- package/schema/examples/workspace/ventures/northstar/pillars/business.md +5 -0
- package/schema/examples/workspace/ventures/northstar/pillars/product.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/AGENTS.md +17 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/accounts/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/decisions/venture.team.decision.json +31 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/knowledge/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/customer-service/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/customer-service/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/finance/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/human-capital/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/human-capital/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/it/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/it/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/marketing-and-sales/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/marketing-and-sales/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/products/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/products/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/strategy/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/strategy/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/pillars/brand.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/pillars/business.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/pillars/product.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/products/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/products/decisions/product.core-product.decision.json +28 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/products/decisions/product.exists.decision.json +32 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/products/decisions/product.flagship.decision.json +27 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/profile.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/venture.json +27 -0
- package/schema/examples/workspace/ventures/northstar/products/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/northstar/profile.md +5 -0
- package/schema/examples/workspace/ventures/northstar/provenance.jsonl +3 -0
- package/schema/examples/workspace/ventures/northstar/purpose/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/venture.json +49 -0
- package/schema/examples/workspace/ventures/studio/accounts/bakery/account.json +18 -0
- package/schema/examples/workspace/ventures/studio/evidence/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/studio/governance/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/studio/knowledge/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/studio/operations/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/studio/print/knowledge/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/studio/print/purpose/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/studio/print/venture.json +37 -0
- package/schema/examples/workspace/ventures/studio/products/brand-care.json +19 -0
- package/schema/examples/workspace/ventures/studio/products/brand-kit.json +23 -0
- package/schema/examples/workspace/ventures/studio/provenance.jsonl +3 -0
- package/schema/examples/workspace/ventures/studio/purpose/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/studio/venture.json +43 -0
- package/schema/examples/workspace/ventures/tandem/accounts/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/tandem/evidence/README.md +3 -0
- package/schema/examples/workspace/ventures/tandem/governance/README.md +3 -0
- package/schema/examples/workspace/ventures/tandem/governance/agreements/dee-fast.md +3 -0
- package/schema/examples/workspace/ventures/tandem/governance/board.json +51 -0
- package/schema/examples/workspace/ventures/tandem/governance/departments/finance/charter.md +5 -0
- package/schema/examples/workspace/ventures/tandem/governance/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/tandem/governance/departments/primary/marketing-and-sales/charter.md +5 -0
- package/schema/examples/workspace/ventures/tandem/governance/departments/primary/marketing-and-sales/department.json +5 -0
- package/schema/examples/workspace/ventures/tandem/governance/exit.json +33 -0
- package/schema/examples/workspace/ventures/tandem/governance/founder-agreement.json +24 -0
- package/schema/examples/workspace/ventures/tandem/governance/founder-agreement.md +3 -0
- package/schema/examples/workspace/ventures/tandem/governance/ownership.json +131 -0
- package/schema/examples/workspace/ventures/tandem/governance/publication-policy.json +171 -0
- package/schema/examples/workspace/ventures/tandem/knowledge/README.md +3 -0
- package/schema/examples/workspace/ventures/tandem/knowledge/research/friends-feedback-2026-08.md +3 -0
- package/schema/examples/workspace/ventures/tandem/knowledge/research/pilot-2026-10.md +3 -0
- package/schema/examples/workspace/ventures/tandem/knowledge/research/problem-interviews-2026-09.md +20 -0
- package/schema/examples/workspace/ventures/tandem/knowledge/sources.json +8 -0
- package/schema/examples/workspace/ventures/tandem/knowledge/where-used.json +13 -0
- package/schema/examples/workspace/ventures/tandem/operations/README.md +3 -0
- package/schema/examples/workspace/ventures/tandem/operations/departments/finance/README.md +5 -0
- package/schema/examples/workspace/ventures/tandem/operations/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/tandem/operations/departments/primary/marketing-and-sales/README.md +5 -0
- package/schema/examples/workspace/ventures/tandem/operations/departments/primary/marketing-and-sales/department.json +5 -0
- package/schema/examples/workspace/ventures/tandem/pillars/brand.md +5 -0
- package/schema/examples/workspace/ventures/tandem/pillars/business.md +5 -0
- package/schema/examples/workspace/ventures/tandem/pillars/product.md +5 -0
- package/schema/examples/workspace/ventures/tandem/products/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/tandem/products/shop-app.json +22 -0
- package/schema/examples/workspace/ventures/tandem/profile.md +5 -0
- package/schema/examples/workspace/ventures/tandem/provenance.jsonl +13 -0
- package/schema/examples/workspace/ventures/tandem/purpose/README.md +3 -0
- package/schema/examples/workspace/ventures/tandem/purpose/telos.json +78 -0
- package/schema/examples/workspace/ventures/tandem/purpose/validation/go-to-market.json +35 -0
- package/schema/examples/workspace/ventures/tandem/purpose/validation/pricing.json +37 -0
- package/schema/examples/workspace/ventures/tandem/purpose/validation/problem.json +74 -0
- package/schema/examples/workspace/ventures/tandem/purpose/validation/product-market-fit.json +66 -0
- package/schema/examples/workspace/ventures/tandem/purpose/validation/solution.json +33 -0
- package/schema/examples/workspace/ventures/tandem/purpose/validation/team.json +52 -0
- package/schema/examples/workspace/ventures/tandem/venture.json +79 -0
- package/schema/examples/workspace/ventures/woodworking/knowledge/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/woodworking/venture.json +21 -0
- package/schema/examples/workspace/workspace.json +8 -0
- package/schema/exit.schema.json +74 -0
- package/schema/foundation.mjs +118 -0
- package/schema/founder-agreement.schema.json +83 -0
- package/schema/founder.schema.json +72 -0
- package/schema/frame.schema.json +240 -0
- package/schema/frames.mjs +228 -0
- package/schema/freshness-log.schema.json +40 -0
- package/schema/freshness-profiles.schema.json +44 -0
- package/schema/freshness.mjs +473 -0
- package/schema/fund-terms.schema.json +107 -0
- package/schema/fund-thesis.schema.json +87 -0
- package/schema/gate-drafts.mjs +130 -0
- package/schema/gate.mjs +133 -0
- package/schema/glossary.schema.json +25 -0
- package/schema/handoff.schema.json +239 -0
- package/schema/icp.schema.json +136 -0
- package/schema/idea-graph.schema.json +61 -0
- package/schema/init-venture.mjs +128 -0
- package/schema/integration.schema.json +143 -0
- package/schema/judgment.schema.json +38 -0
- package/schema/kit.schema.json +47 -0
- package/schema/kits.mjs +24 -0
- package/schema/knowledge-sources.schema.json +260 -0
- package/schema/layer.json +59 -0
- package/schema/layer.schema.json +119 -0
- package/schema/load-packages.mjs +26 -0
- package/schema/marketing-brand.schema.json +116 -0
- package/schema/marketing-sitemap.schema.json +232 -0
- package/schema/migrate-venture.mjs +192 -0
- package/schema/migrations/kit-to-package.mjs +94 -0
- package/schema/migrations/package-layout.mjs +86 -0
- package/schema/model-steps.mjs +717 -0
- package/schema/money-summary.schema.json +138 -0
- package/schema/naive-config.mjs +165 -0
- package/schema/naive-config.schema.json +268 -0
- package/schema/need-now.json +772 -0
- package/schema/need-now.mjs +108 -0
- package/schema/nextjs-status.schema.json +29 -0
- package/schema/ownership.schema.json +282 -0
- package/schema/packages.json +4 -0
- package/schema/packages.mjs +252 -0
- package/schema/payouts.mjs +91 -0
- package/schema/people.schema.json +86 -0
- package/schema/port-venture.mjs +161 -0
- package/schema/product.schema.json +223 -0
- package/schema/provenance-entry.schema.json +154 -0
- package/schema/public-assets.schema.json +76 -0
- package/schema/publication-policy.schema.json +293 -0
- package/schema/raw-source.schema.json +15 -0
- package/schema/reference.schema.json +115 -0
- package/schema/release-read.mjs +111 -0
- package/schema/releases.mjs +497 -0
- package/schema/route-aliases.schema.json +25 -0
- package/schema/run-handoff.mjs +51 -0
- package/schema/scaffold/defaults.json +54 -0
- package/schema/setup.mjs +164 -0
- package/schema/site-presence.schema.json +337 -0
- package/schema/stale.mjs +111 -0
- package/schema/start-release.mjs +41 -0
- package/schema/strategic-foundation.schema.json +74 -0
- package/schema/stream.schema.json +14 -0
- package/schema/structure.mjs +186 -0
- package/schema/systems-catalog.json +126 -0
- package/schema/systems-catalog.schema.json +78 -0
- package/schema/team-plan.schema.json +157 -0
- package/schema/telos.schema.json +197 -0
- package/schema/time-to-ready.mjs +93 -0
- package/schema/trigger.schema.json +44 -0
- package/schema/triggers.mjs +237 -0
- package/schema/upgrade-registry.schema.json +60 -0
- package/schema/upgrade-venture.mjs +107 -0
- package/schema/upgrades.json +69 -0
- package/schema/upgrades.mjs +385 -0
- package/schema/use-model.mjs +10 -0
- package/schema/validate.py +58 -0
- package/schema/validation-evidence.schema.json +123 -0
- package/schema/validation-go-to-market.schema.json +110 -0
- package/schema/validation-operations-readiness.schema.json +91 -0
- package/schema/validation-pricing.schema.json +114 -0
- package/schema/validation-problem.schema.json +118 -0
- package/schema/validation-product-market-fit.schema.json +135 -0
- package/schema/validation-solution.schema.json +79 -0
- package/schema/validation-team.schema.json +116 -0
- package/schema/venture-role.schema.json +64 -0
- package/schema/venture-type.mjs +62 -0
- package/schema/venture-types.json +346 -0
- package/schema/venture-types.schema.json +129 -0
- package/schema/venture.schema.json +460 -0
- package/schema/vocab/business-models.json +298 -0
- package/schema/where-used.schema.json +56 -0
- package/schema/workspace.schema.json +38 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: venture-template-role
|
|
3
|
+
ai-model: claude-opus-5
|
|
4
|
+
role: talent-acquisition-manager
|
|
5
|
+
primary-pillar: business
|
|
6
|
+
secondary-pillars: [product, brand]
|
|
7
|
+
source: hybrid
|
|
8
|
+
created: 2026-08-10
|
|
9
|
+
last-reviewed: 2026-08-10
|
|
10
|
+
authorship: hybrid
|
|
11
|
+
ip-sensitivity: normal
|
|
12
|
+
scope: global
|
|
13
|
+
scope-entity: "[[everything-ecosystem]]"
|
|
14
|
+
tags: [venture-template, role, talent-acquisition, recruiting, business-pillar, stub]
|
|
15
|
+
canonical-for: "talent-acquisition-manager-role-reference"
|
|
16
|
+
related:
|
|
17
|
+
- "[[governance/venture-template/roles/README]]"
|
|
18
|
+
- "[[position-schema]]"
|
|
19
|
+
- "[[role-and-candidate-authoring]]"
|
|
20
|
+
- "[[hr-manager]]"
|
|
21
|
+
status: STUB
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Talent Acquisition Manager
|
|
25
|
+
|
|
26
|
+
> **Purpose:** Owns the recruiting pipeline — role intake, sourcing, screening coordination, offer process — for seats the company has decided to fill with humans.
|
|
27
|
+
|
|
28
|
+
## Primary pillar
|
|
29
|
+
|
|
30
|
+
- **Business** (people / growth). Partners with hiring managers in Product and Brand.
|
|
31
|
+
|
|
32
|
+
## Typical responsibilities
|
|
33
|
+
|
|
34
|
+
- Translate position instances + [[role-and-candidate-authoring]] artifacts into search plans
|
|
35
|
+
- Pipeline health; candidate experience; interview loop logistics
|
|
36
|
+
- Close coordination with HR Manager on offers / onboarding handoff
|
|
37
|
+
- Does **not** invent headcount — consumes approved vacant positions with human staffing posture
|
|
38
|
+
|
|
39
|
+
## Staffing posture (default for instances)
|
|
40
|
+
|
|
41
|
+
- `human-required` for the TA manager seat once volume justifies a specialist
|
|
42
|
+
- Pipeline **triage / scheduling / draft outreach** may be `agent-capable` as *duties* under a hybrid seat or supporting agent roles — not a substitute for the TA seat’s judgment on fit
|
|
43
|
+
|
|
44
|
+
## Position instances
|
|
45
|
+
|
|
46
|
+
Per [[position-schema]]. Link assignments to open reqs / position vacancies.
|
|
47
|
+
|
|
48
|
+
## Status
|
|
49
|
+
|
|
50
|
+
Stub 2026-08-10.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.0",
|
|
3
|
+
"note": "Roles a person can hold in a venture (EE-082). Agent roles are in agent-roles.json.",
|
|
4
|
+
"roles": [
|
|
5
|
+
{
|
|
6
|
+
"id": "founder",
|
|
7
|
+
"name": "Founder",
|
|
8
|
+
"kind": "builder",
|
|
9
|
+
"description": "Started the venture and owns it; alone, owns every function",
|
|
10
|
+
"founder": true,
|
|
11
|
+
"owns_when_solo": true
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "co-founder",
|
|
15
|
+
"name": "Co-founder",
|
|
16
|
+
"kind": "builder",
|
|
17
|
+
"description": "One of two or more founders; owns the functions the team assigns",
|
|
18
|
+
"founder": true,
|
|
19
|
+
"owns_when_solo": true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "general-partner",
|
|
23
|
+
"name": "General partner",
|
|
24
|
+
"kind": "investor",
|
|
25
|
+
"description": "Runs a fund or firm: sets the thesis, raises from limited partners, makes and manages investments",
|
|
26
|
+
"founder": true,
|
|
27
|
+
"owns_when_solo": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "limited-partner",
|
|
31
|
+
"name": "Limited partner",
|
|
32
|
+
"kind": "investor",
|
|
33
|
+
"description": "Commits capital to a fund and receives reports; does not run it",
|
|
34
|
+
"founder": false,
|
|
35
|
+
"owns_when_solo": false
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "operator",
|
|
39
|
+
"name": "Operator",
|
|
40
|
+
"kind": "operator",
|
|
41
|
+
"description": "Runs one or more functions without founding the venture: an early employee or executive",
|
|
42
|
+
"founder": false,
|
|
43
|
+
"owns_when_solo": false
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "advisor",
|
|
47
|
+
"name": "Advisor",
|
|
48
|
+
"kind": "advisor",
|
|
49
|
+
"description": "Advises the founders; owns no function",
|
|
50
|
+
"founder": false,
|
|
51
|
+
"owns_when_solo": false
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "board-member",
|
|
55
|
+
"name": "Board member",
|
|
56
|
+
"kind": "governor",
|
|
57
|
+
"description": "Sits on the board and governs; owns no function",
|
|
58
|
+
"founder": false,
|
|
59
|
+
"owns_when_solo": false
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Who is acting (M-18, like cookies in a Server Action) and access on every read (F-5). Every action
|
|
2
|
+
// through the router carries who is acting, a person or an agent, and in which team-plan role. The
|
|
3
|
+
// router checks it before anything else, on every call: the actor is a person or an agent, an agent
|
|
4
|
+
// never acts in a role a person holds, and a venture can refuse role ids its team plan does not list
|
|
5
|
+
// (naive.config.json acting.unknown_roles). Each answer carries `acting` back. When who is acting
|
|
6
|
+
// changes between two calls on one interface, or the role's entry in the team plan changes, the next
|
|
7
|
+
// answer carries `acting_changed` with the routes the new identity may reach: the re-render.
|
|
8
|
+
//
|
|
9
|
+
// Access (P-27) is checked again at the record: a list read returns only the items the role may read,
|
|
10
|
+
// so a role allowed one product never sees the others. Credentials never enter here; connectors keep
|
|
11
|
+
// them, and the platform's stay in platform/ (EE-041).
|
|
12
|
+
|
|
13
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
14
|
+
import { createHash } from "node:crypto";
|
|
15
|
+
import { globsOf, mayReadItem, mayReadSome, roleOf, teamPlan } from "../schema/access.mjs";
|
|
16
|
+
import { configFor } from "../schema/naive-config.mjs";
|
|
17
|
+
|
|
18
|
+
export { mayReadItem, mayReadSome };
|
|
19
|
+
|
|
20
|
+
/** Checks who is acting on a venture. Returns { ok, who: { kind, role, known, occupant } } or { ok: false, error }. */
|
|
21
|
+
export function actingOf(dir, kind, roleId) {
|
|
22
|
+
const who = { kind, role: roleId ?? null };
|
|
23
|
+
if (kind !== "agent" && kind !== "person") return { ok: false, error: `the actor is a person or an agent, not ${kind}`, who };
|
|
24
|
+
if (!dir || !roleId) return { ok: true, who };
|
|
25
|
+
const plan = teamPlan(dir);
|
|
26
|
+
if (!plan) return { ok: true, who };
|
|
27
|
+
const role = (plan.roles ?? []).find((r) => r.id === roleId);
|
|
28
|
+
if (!role) {
|
|
29
|
+
let mode = "allow";
|
|
30
|
+
try { mode = configFor(dir).acting?.unknown_roles ?? "allow"; } catch {}
|
|
31
|
+
if (mode === "refuse") return { ok: false, error: `${roleId} is not a role in the team plan, and naive.config.json refuses unknown roles (acting.unknown_roles)`, who };
|
|
32
|
+
return { ok: true, who: { ...who, known: false } };
|
|
33
|
+
}
|
|
34
|
+
if (kind === "agent" && role.occupant === "person") return { ok: false, error: `${roleId} is a person's role in the team plan: an agent may not act in it`, who };
|
|
35
|
+
return { ok: true, who: { ...who, known: true, occupant: role.occupant } };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** A fingerprint of who is acting: kind, role and the role's team-plan entry, so a changed entry counts as a change. */
|
|
39
|
+
export function fingerprint(dir, who) {
|
|
40
|
+
return createHash("sha256").update(JSON.stringify({ kind: who.kind, role: who.role, entry: dir && who.role ? roleOf(dir, who.role) : null })).digest("hex");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The routes an identity may reach: globs to read and write. */
|
|
44
|
+
export function reach(dir, roleId) {
|
|
45
|
+
const g = dir && roleId ? globsOf(dir, roleId) : null;
|
|
46
|
+
return g ?? { read: ["**"], write: ["**"] };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The id of a collection item from its file, given the collection's file patterns (products/*.json). */
|
|
50
|
+
export function itemId(patterns, path) {
|
|
51
|
+
for (const g of patterns) {
|
|
52
|
+
if (!g.includes("*")) continue;
|
|
53
|
+
const m = path.match(new RegExp("^" + g.split("*").map((s) => s.replace(/[.+^${}()|[\]\\]/g, "\\$&")).join("([^/]*)") + "$"));
|
|
54
|
+
if (m) return m[1];
|
|
55
|
+
}
|
|
56
|
+
return path;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const nested = new AsyncLocalStorage();
|
|
60
|
+
const last = new Map();
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Runs one router action with who is acting checked first and carried on the answer. inner is the
|
|
64
|
+
* router's own call; findDir finds a venture folder. Calls the router makes inside another call
|
|
65
|
+
* (a view's read, the overview's slots) are checked too, but only the outer call tracks changes.
|
|
66
|
+
*/
|
|
67
|
+
export async function actingCall(a, inner, findDir) {
|
|
68
|
+
const kind = a.actor ?? "agent", role = a.actor_id ?? process.env.MENTURA_ACTOR_ID;
|
|
69
|
+
let dir = null;
|
|
70
|
+
try { dir = a.venture ? findDir(a.venture, a.workspace) : null; } catch {}
|
|
71
|
+
const check = actingOf(dir, kind, role);
|
|
72
|
+
const acting = { kind, role: role ?? null };
|
|
73
|
+
if (!check.ok) return { ok: false, error: check.error, acting };
|
|
74
|
+
if (nested.getStore()) return { ...(await inner(a)), acting };
|
|
75
|
+
let changed = null;
|
|
76
|
+
if (dir) {
|
|
77
|
+
const key = `${dir}\0${a.via ?? "router"}`, fp = fingerprint(dir, check.who), prev = last.get(key);
|
|
78
|
+
if (prev && prev.fp !== fp) changed = { from: prev.acting, to: acting, may: reach(dir, role) };
|
|
79
|
+
last.set(key, { fp, acting });
|
|
80
|
+
}
|
|
81
|
+
const r = await nested.run(true, () => inner(a));
|
|
82
|
+
return { ...r, acting, ...(changed ? { acting_changed: changed } : {}) };
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claude-code",
|
|
3
|
+
"title": "Claude Code",
|
|
4
|
+
"kind": "harness",
|
|
5
|
+
"integration": "claude-code",
|
|
6
|
+
"reads": ["CLAUDE.md", ".claude/skills/*/SKILL.md"],
|
|
7
|
+
"files": [
|
|
8
|
+
{ "path": "CLAUDE.md", "text": "@AGENTS.md\n" }
|
|
9
|
+
],
|
|
10
|
+
"skills": ".claude/skills",
|
|
11
|
+
"sources": [
|
|
12
|
+
"https://docs.claude.com/en/docs/claude-code/memory",
|
|
13
|
+
"https://docs.claude.com/en/docs/claude-code/skills"
|
|
14
|
+
],
|
|
15
|
+
"note": "Claude Code reads CLAUDE.md, which imports the venture's AGENTS.md with @AGENTS.md, and loads project skills from .claude/skills/<name>/SKILL.md. The adapter copies the skill of each package open now, so the agent has the installed version's skill."
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "codex",
|
|
3
|
+
"title": "Codex",
|
|
4
|
+
"kind": "harness",
|
|
5
|
+
"integration": "codex",
|
|
6
|
+
"reads": ["AGENTS.md"],
|
|
7
|
+
"files": [],
|
|
8
|
+
"skills": null,
|
|
9
|
+
"sources": [
|
|
10
|
+
"https://agents.md/",
|
|
11
|
+
"https://github.com/openai/codex"
|
|
12
|
+
],
|
|
13
|
+
"note": "Codex reads AGENTS.md natively, from the venture root down to the folder it works in, which is the layout chain Naive already writes. Nothing else is needed."
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cursor",
|
|
3
|
+
"title": "Cursor",
|
|
4
|
+
"kind": "harness",
|
|
5
|
+
"integration": "cursor",
|
|
6
|
+
"reads": ["AGENTS.md", ".cursor/rules/*.mdc"],
|
|
7
|
+
"files": [
|
|
8
|
+
{ "path": ".cursor/rules/naive.mdc", "text": "---\ndescription: How to work in this Naive venture\nalwaysApply: true\n---\n\nRead AGENTS.md at the venture root, and the AGENTS.md of each folder down to the one you work in, before writing anything. Write records through the router (node interface/cli/mentura.mjs), never by editing files, and never read _private/.\n" }
|
|
9
|
+
],
|
|
10
|
+
"skills": null,
|
|
11
|
+
"sources": [
|
|
12
|
+
"https://docs.cursor.com/context/rules",
|
|
13
|
+
"https://agents.md/"
|
|
14
|
+
],
|
|
15
|
+
"note": "Cursor reads AGENTS.md and project rules in .cursor/rules/. The adapter adds one rule that always applies and points at the AGENTS.md chain."
|
|
16
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Adapters (Z-4). Next.js adapters let a platform customize build and deploy, and a verified adapter
|
|
3
|
+
// passes the Next.js test suite. Naive's adapters run the framework on a platform or in an agent
|
|
4
|
+
// harness. Mentura is the first, as Vercel is for Next.js (platform/adapter.json). Claude Code, Codex and
|
|
5
|
+
// Cursor adapt the framework through the venture's AGENTS.md and skills (interface/adapters/*.json):
|
|
6
|
+
// adapt() writes the entry files a harness reads and copies the skills of the packages open now. An
|
|
7
|
+
// adapter is verified when it passes the framework's tests: verify() runs them.
|
|
8
|
+
//
|
|
9
|
+
// node interface/adapters.mjs [--json] the adapters
|
|
10
|
+
// node interface/adapters.mjs adapt <adapter> <venture dir> write a harness's files into a venture
|
|
11
|
+
// node interface/adapters.mjs verify [<adapter>] [--json] run the framework's tests an adapter must pass
|
|
12
|
+
//
|
|
13
|
+
// adapt() records what it wrote in <venture>/.naive/adapters.json and never overwrites a file it did not
|
|
14
|
+
// write, or one a person changed since: it keeps theirs and says so. An upgrade refreshes the adapters
|
|
15
|
+
// a venture has (schema/upgrades.mjs), so the skill copies follow the installed packages.
|
|
16
|
+
|
|
17
|
+
import { spawnSync } from "node:child_process";
|
|
18
|
+
import { createHash } from "node:crypto";
|
|
19
|
+
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
20
|
+
import { tmpdir } from "node:os";
|
|
21
|
+
import { dirname, join } from "node:path";
|
|
22
|
+
|
|
23
|
+
const repo = new URL("..", import.meta.url).pathname;
|
|
24
|
+
export const STATE = ".naive/adapters.json";
|
|
25
|
+
const load = (p) => JSON.parse(readFileSync(p, "utf8"));
|
|
26
|
+
const sha = (s) => createHash("sha256").update(s).digest("hex");
|
|
27
|
+
|
|
28
|
+
/** Every adapter: the harness adapters in interface/adapters/, and the platform's if this copy has one. */
|
|
29
|
+
export function adapters() {
|
|
30
|
+
const d = join(repo, "interface/adapters");
|
|
31
|
+
const out = existsSync(d) ? readdirSync(d).filter((f) => f.endsWith(".json")).sort().map((f) => ({ ...load(join(d, f)), path: `interface/adapters/${f}` })) : [];
|
|
32
|
+
if (existsSync(join(repo, "platform/adapter.json"))) out.unshift({ ...load(join(repo, "platform/adapter.json")), path: "platform/adapter.json" });
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
const byName = (name) => { const a = adapters().find((x) => x.name === name); if (!a) throw new Error(`no adapter ${name}: ${adapters().map((x) => x.name).join(", ")}`); return a; };
|
|
36
|
+
|
|
37
|
+
/** The skills of the packages open now in a venture: [{ id, path, package }]. */
|
|
38
|
+
export async function skillsFor(dir) {
|
|
39
|
+
const { packages } = await import("../schema/packages.mjs");
|
|
40
|
+
const p = packages(dir);
|
|
41
|
+
return [...p.core, ...p.handoff].filter((x) => x.in === "now").flatMap((x) => {
|
|
42
|
+
const f = join(repo, "packages", x.id, "package.json");
|
|
43
|
+
const s = existsSync(f) ? load(f).skill : null;
|
|
44
|
+
return s && existsSync(join(repo, s.path)) ? [{ id: s.id, path: s.path, package: x.id }] : [];
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const readState = (dir) => (existsSync(join(dir, STATE)) ? load(join(dir, STATE)) : { adapters: {} });
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Writes a harness adapter's files into a venture: its entry files, and a copy of each open package's
|
|
52
|
+
* skill in its skills folder. Returns what it wrote, what was already current, and what it kept.
|
|
53
|
+
*/
|
|
54
|
+
export async function adapt(dir, name) {
|
|
55
|
+
if (!existsSync(join(dir, "venture.json"))) throw new Error(`${dir} is not a venture`);
|
|
56
|
+
const a = byName(name);
|
|
57
|
+
if (a.kind !== "harness") throw new Error(`${name} is a ${a.kind} adapter: it runs the framework itself and writes nothing into a venture`);
|
|
58
|
+
const state = readState(dir);
|
|
59
|
+
const mine = state.adapters[name]?.files ?? {};
|
|
60
|
+
const want = [...a.files.map((f) => ({ path: f.path, text: f.text }))];
|
|
61
|
+
if (a.skills) for (const s of await skillsFor(dir)) want.push({ path: `${a.skills}/${s.id}/SKILL.md`, text: readFileSync(join(repo, s.path), "utf8"), skill: s.id, package: s.package });
|
|
62
|
+
const written = [], current = [], kept = [], files = {};
|
|
63
|
+
for (const w of want) {
|
|
64
|
+
const f = join(dir, w.path);
|
|
65
|
+
const now = existsSync(f) ? readFileSync(f, "utf8") : null;
|
|
66
|
+
if (now === w.text) { current.push(w.path); files[w.path] = sha(w.text); continue; }
|
|
67
|
+
// Never overwrite a file a person wrote, or one they changed after the adapter wrote it.
|
|
68
|
+
if (now !== null && mine[w.path] !== sha(now)) { kept.push({ path: w.path, why: mine[w.path] ? "changed since the adapter wrote it" : "it was there before the adapter" }); if (mine[w.path]) files[w.path] = mine[w.path]; continue; }
|
|
69
|
+
mkdirSync(dirname(f), { recursive: true });
|
|
70
|
+
writeFileSync(f, w.text);
|
|
71
|
+
written.push(w.path);
|
|
72
|
+
files[w.path] = sha(w.text);
|
|
73
|
+
}
|
|
74
|
+
// A skill copy for a package that is no longer open goes, if the adapter wrote it and nobody changed it.
|
|
75
|
+
const removed = [];
|
|
76
|
+
for (const [p, h] of Object.entries(mine)) {
|
|
77
|
+
if (want.some((w) => w.path === p) || !existsSync(join(dir, p))) continue;
|
|
78
|
+
if (sha(readFileSync(join(dir, p), "utf8")) === h) { rmSync(join(dir, p)); removed.push(p); } else kept.push({ path: p, why: "no longer needed, but changed by a person, so kept" });
|
|
79
|
+
}
|
|
80
|
+
state.adapters[name] = { at: new Date().toISOString(), files };
|
|
81
|
+
mkdirSync(join(dir, ".naive"), { recursive: true });
|
|
82
|
+
writeFileSync(join(dir, STATE), JSON.stringify(state, null, 2) + "\n");
|
|
83
|
+
return { adapter: name, written, current, kept, removed, skills: want.filter((w) => w.skill).map((w) => w.skill) };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Re-adapts every adapter the venture has, after an upgrade. */
|
|
87
|
+
export async function refresh(dir) {
|
|
88
|
+
const names = Object.keys(readState(dir).adapters);
|
|
89
|
+
const out = [];
|
|
90
|
+
for (const n of names) { try { out.push(await adapt(dir, n)); } catch (e) { out.push({ adapter: n, error: e.message }); } }
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// The framework's tests for a harness adapter, run on a new venture in a temporary folder.
|
|
95
|
+
async function harnessSuite(a) {
|
|
96
|
+
const results = [];
|
|
97
|
+
const t = (test, passed, detail = "") => results.push({ test, passed: !!passed, detail });
|
|
98
|
+
const ws = mkdtempSync(join(tmpdir(), `naive-adapter-${a.name}-`));
|
|
99
|
+
try {
|
|
100
|
+
const dir = join(ws, "adapted");
|
|
101
|
+
const init = spawnSync("node", [join(repo, "schema/init-venture.mjs"), dir, "adapted"], { encoding: "utf8" });
|
|
102
|
+
const up = spawnSync("node", [join(repo, "schema/upgrade-venture.mjs"), dir], { encoding: "utf8" });
|
|
103
|
+
t("a new venture is created and upgraded to the installed framework", init.status === 0 && up.status === 0, init.stderr + up.stderr);
|
|
104
|
+
const first = await adapt(dir, a.name);
|
|
105
|
+
t("every entry file is written with the adapter's text", a.files.every((f) => existsSync(join(dir, f.path)) && readFileSync(join(dir, f.path), "utf8") === f.text), JSON.stringify(first.written));
|
|
106
|
+
t("the harness reaches the venture's AGENTS.md (it reads it, or an entry file imports or names it)", a.reads.includes("AGENTS.md") || a.files.some((f) => /(^|\s)@AGENTS\.md\b|AGENTS\.md/.test(f.text)));
|
|
107
|
+
t("no entry file is private or outside the venture", a.files.every((f) => !f.path.startsWith("_private/") && !f.path.includes("..") && !f.path.startsWith("/")));
|
|
108
|
+
const { call } = await import("./router.mjs");
|
|
109
|
+
const lay = await call({ venture: "adapted", workspace: ws, route: "foundation/problem", action: "layout" });
|
|
110
|
+
t("the layout an agent gets starts with the venture's AGENTS.md and its instructions", lay.ok && lay.result.chain[0]?.path === "AGENTS.md" && lay.result.instructions.private === "_private/", lay.error ?? "");
|
|
111
|
+
if (a.skills) {
|
|
112
|
+
const want = await skillsFor(dir);
|
|
113
|
+
t("the venture has packages open now with skills to copy", want.length > 0, "no open package has a skill");
|
|
114
|
+
t("each open package's skill is copied byte for byte where the harness loads skills", want.every((s) => existsSync(join(dir, a.skills, s.id, "SKILL.md")) && readFileSync(join(dir, a.skills, s.id, "SKILL.md"), "utf8") === readFileSync(join(repo, s.path), "utf8")), JSON.stringify(want.map((s) => s.id)));
|
|
115
|
+
rmSync(join(dir, a.skills, want[0].id, "SKILL.md"));
|
|
116
|
+
const back = await refresh(dir);
|
|
117
|
+
t("a refresh (as after an upgrade) puts a missing skill copy back", back[0]?.written?.includes(`${a.skills}/${want[0].id}/SKILL.md`), JSON.stringify(back));
|
|
118
|
+
}
|
|
119
|
+
const again = await adapt(dir, a.name);
|
|
120
|
+
t("adapting again changes nothing", again.written.length === 0 && again.kept.length === 0, JSON.stringify(again));
|
|
121
|
+
if (a.files.length) {
|
|
122
|
+
const f = join(dir, a.files[0].path);
|
|
123
|
+
writeFileSync(f, readFileSync(f, "utf8") + "\nThe founder's own line.\n");
|
|
124
|
+
const edited = readFileSync(f, "utf8");
|
|
125
|
+
const kept = await adapt(dir, a.name);
|
|
126
|
+
t("a file the founder changed is kept, never overwritten", kept.kept.some((k) => k.path === a.files[0].path) && readFileSync(f, "utf8") === edited, JSON.stringify(kept));
|
|
127
|
+
const other = join(ws, "own");
|
|
128
|
+
spawnSync("node", [join(repo, "schema/init-venture.mjs"), other, "own"], { encoding: "utf8" });
|
|
129
|
+
mkdirSync(dirname(join(other, a.files[0].path)), { recursive: true });
|
|
130
|
+
writeFileSync(join(other, a.files[0].path), "the founder's own file\n");
|
|
131
|
+
const theirs = await adapt(other, a.name);
|
|
132
|
+
t("a file that was there before the adapter is kept", theirs.kept.some((k) => k.path === a.files[0].path) && readFileSync(join(other, a.files[0].path), "utf8") === "the founder's own file\n", JSON.stringify(theirs));
|
|
133
|
+
}
|
|
134
|
+
} catch (e) { t("the suite ran to the end", false, String(e.stack ?? e)); }
|
|
135
|
+
finally { rmSync(ws, { recursive: true, force: true }); }
|
|
136
|
+
return results;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// A platform adapter runs the framework itself; it is verified by the test programs it names.
|
|
140
|
+
function platformSuite(a) {
|
|
141
|
+
if (!a.verify?.length) return [{ test: "names the framework tests it must pass", passed: false, detail: "verify is empty" }];
|
|
142
|
+
return a.verify.map((p) => {
|
|
143
|
+
if (!existsSync(join(repo, p))) return { test: p, passed: false, detail: "not found" };
|
|
144
|
+
const r = spawnSync("node", [join(repo, p)], { cwd: repo, encoding: "utf8", timeout: 600000 });
|
|
145
|
+
const tail = (r.stdout + r.stderr).trim().split("\n").slice(-4).join(" / ");
|
|
146
|
+
return { test: p, passed: r.status === 0, detail: tail };
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Runs the framework's tests for one adapter: { adapter, kind, verified, results }. */
|
|
151
|
+
export async function verify(name) {
|
|
152
|
+
const a = byName(name);
|
|
153
|
+
const results = a.kind === "harness" ? await harnessSuite(a) : platformSuite(a);
|
|
154
|
+
return { adapter: a.name, kind: a.kind, verified: results.every((r) => r.passed), results };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
158
|
+
const [cmd, ...rest] = process.argv.slice(2).filter((x) => x !== "--json");
|
|
159
|
+
const json = process.argv.includes("--json");
|
|
160
|
+
try {
|
|
161
|
+
if (!cmd) {
|
|
162
|
+
const list = adapters().map((a) => ({ name: a.name, title: a.title, kind: a.kind, path: a.path, reads: a.reads }));
|
|
163
|
+
console.log(json ? JSON.stringify(list, null, 2) : list.map((a) => `${a.name.padEnd(12)} ${a.kind.padEnd(9)} ${a.path} reads ${a.reads.join(", ")}`).join("\n"));
|
|
164
|
+
} else if (cmd === "adapt") {
|
|
165
|
+
const [name, dir] = rest;
|
|
166
|
+
if (!name || !dir) throw new Error("usage: node interface/adapters.mjs adapt <adapter> <venture dir>");
|
|
167
|
+
const r = await adapt(dir, name);
|
|
168
|
+
console.log(json ? JSON.stringify(r, null, 2) : [`adapted for ${r.adapter}: ${r.written.length} written, ${r.current.length} already current, ${r.kept.length} kept${r.skills.length ? `; skills: ${r.skills.join(", ")}` : ""}`,
|
|
169
|
+
...r.written.map((p) => `wrote ${p}`), ...r.kept.map((k) => `kept ${k.path} (${k.why})`), ...r.removed.map((p) => `removed ${p}`)].join("\n"));
|
|
170
|
+
} else if (cmd === "verify") {
|
|
171
|
+
const names = rest.length ? rest : adapters().map((a) => a.name);
|
|
172
|
+
const rs = [];
|
|
173
|
+
for (const n of names) rs.push(await verify(n));
|
|
174
|
+
if (json) console.log(JSON.stringify(rs, null, 2));
|
|
175
|
+
else for (const r of rs) {
|
|
176
|
+
console.log(`${r.verified ? "verified" : "NOT verified"} ${r.adapter} (${r.kind})`);
|
|
177
|
+
for (const x of r.results) console.log(` ${x.passed ? "pass" : "FAIL"} ${x.test}${x.passed ? "" : ` ${x.detail}`}`);
|
|
178
|
+
}
|
|
179
|
+
process.exit(rs.every((r) => r.verified) ? 0 : 1);
|
|
180
|
+
} else throw new Error("usage: node interface/adapters.mjs [adapt <adapter> <venture dir> | verify [<adapter>]] [--json]");
|
|
181
|
+
} catch (e) { console.error(e.message); process.exit(1); }
|
|
182
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The HTTP API over the router (EE-030). Local by default: it binds to 127.0.0.1 and has no
|
|
3
|
+
// authentication, so it is for one builder's machine, not the internet. Every caller is treated as
|
|
4
|
+
// an agent, so gated records are written as drafts for a person to accept.
|
|
5
|
+
//
|
|
6
|
+
// node interface/api/server.mjs [--port 4330]
|
|
7
|
+
//
|
|
8
|
+
// GET /routes, /groups the route table; route groups by phase
|
|
9
|
+
// GET /ventures ventures in the workspace
|
|
10
|
+
// GET /templates/<route> a record's template
|
|
11
|
+
// GET /ventures/<venture> the venture overview (system/overview)
|
|
12
|
+
// GET /ventures/<venture>/<route> read a record (a collection item: <route>/<id>)
|
|
13
|
+
// GET /ventures/<venture>/<route>/view the route as a Markdown page
|
|
14
|
+
// GET /ventures/<venture>/<route>/layout the layout an agent gets before acting
|
|
15
|
+
// PUT /ventures/<venture>/<route> write a record (JSON body); provenance from the
|
|
16
|
+
// headers x-mentura-derived-from (comma-separated), x-mentura-decision, x-mentura-model;
|
|
17
|
+
// the role acting from x-mentura-actor (checked against the team plan's routes); a confidence
|
|
18
|
+
// score computed before the write from x-mentura-confidence
|
|
19
|
+
// POST /ventures/<venture>/<route>/check run its checks
|
|
20
|
+
// POST /ventures/<venture>/<route>/run run a command route (optional JSON body {value})
|
|
21
|
+
//
|
|
22
|
+
// <venture> is an id or, for a nested venture, its folder path (studio/print).
|
|
23
|
+
|
|
24
|
+
import { createServer } from "node:http";
|
|
25
|
+
import { call, groups, resolve, routes, ventureDir, ventures } from "../router.mjs";
|
|
26
|
+
|
|
27
|
+
const status = (r) => r.ok ? 200 : /^no (route|venture)/.test(r.error ?? "") ? 404 : /has no action/.test(r.error ?? "") ? 405 : / may not /.test(r.error ?? "") ? 403 : 422;
|
|
28
|
+
const VERBS = { check: "POST", run: "POST", view: "GET", layout: "GET" };
|
|
29
|
+
|
|
30
|
+
export async function route(method, url, body, headers = {}) {
|
|
31
|
+
const path = decodeURIComponent(new URL(url, "http://x").pathname).replace(/\/+$/, "");
|
|
32
|
+
if (method === "GET" && path === "/routes") return [200, routes()];
|
|
33
|
+
if (method === "GET" && path === "/ventures") return [200, ventures().map(({ id, name, phase }) => ({ id, name, phase }))];
|
|
34
|
+
let m = path.match(/^\/templates\/(.+)$/);
|
|
35
|
+
if (method === "GET" && m) { const r = await call({ route: m[1], action: "template" }); return [status(r), r]; }
|
|
36
|
+
if (method === "GET" && path === "/groups") return [200, groups()];
|
|
37
|
+
m = path.match(/^\/ventures\/(.+)$/);
|
|
38
|
+
if (!m) return [404, { ok: false, error: `no endpoint ${method} ${path}` }];
|
|
39
|
+
// [...venture]: the longest leading run of segments that names a venture; the rest is the route.
|
|
40
|
+
const parts = m[1].split("/");
|
|
41
|
+
let venture, rest;
|
|
42
|
+
for (let i = parts.length; i >= 1; i--) if (ventureDir(parts.slice(0, i).join("/"))) { venture = parts.slice(0, i).join("/"); rest = parts.slice(i); break; }
|
|
43
|
+
if (!venture) return [404, { ok: false, error: `no venture in ${path}` }];
|
|
44
|
+
if (!rest.length) { if (method !== "GET") return [405, { ok: false, error: `${method} is not allowed on ${path}` }]; const r = await call({ venture, route: "system/overview", action: "run", via: "api" }); return [status(r), r]; }
|
|
45
|
+
let verb = VERBS[rest.at(-1)] && resolve(rest.slice(0, -1).join("/")).r ? rest.pop() : null;
|
|
46
|
+
const rt = rest.join("/");
|
|
47
|
+
const action = verb ?? (method === "GET" ? "read" : method === "PUT" ? "write" : null);
|
|
48
|
+
if (!action || (verb && VERBS[verb] !== method)) return [405, { ok: false, error: `${method} is not allowed on ${path}` }];
|
|
49
|
+
const h = (k) => headers[k] || undefined;
|
|
50
|
+
const r = await call({ venture, route: rt, action, input: body, actor: "agent", actor_id: h("x-mentura-actor"), via: "api",
|
|
51
|
+
// Gate group hook (X-4): x-mentura-confidence carries a score computed before the write, for the gate's confidence rules.
|
|
52
|
+
provenance: { derived_from: h("x-mentura-derived-from")?.split(",").map((x) => x.trim()).filter(Boolean), decision: h("x-mentura-decision"), confidence: h("x-mentura-confidence"),
|
|
53
|
+
agent: Object.fromEntries(Object.entries({ model: h("x-mentura-model"), harness: h("user-agent") }).filter(([, v]) => v)) } });
|
|
54
|
+
return [status(r), r];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
58
|
+
const i = process.argv.indexOf("--port");
|
|
59
|
+
const port = i >= 0 ? Number(process.argv[i + 1]) : 4330;
|
|
60
|
+
createServer((req, res) => {
|
|
61
|
+
let raw = "";
|
|
62
|
+
req.on("data", (c) => { raw += c; if (raw.length > 1e6) req.destroy(); });
|
|
63
|
+
req.on("end", async () => {
|
|
64
|
+
let body;
|
|
65
|
+
try { body = raw ? JSON.parse(raw) : undefined; } catch { res.writeHead(400, { "content-type": "application/json" }); res.end(JSON.stringify({ ok: false, error: "body is not JSON" })); return; }
|
|
66
|
+
const [code, out] = await route(req.method, req.url, body, req.headers);
|
|
67
|
+
res.writeHead(code, { "content-type": "application/json" });
|
|
68
|
+
res.end(JSON.stringify(out, null, 2));
|
|
69
|
+
});
|
|
70
|
+
}).listen(port, "127.0.0.1", () => console.log(`mentura API on http://127.0.0.1:${port}`));
|
|
71
|
+
}
|