naive-framework 0.0.0-stage → 0.1.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 +61 -0
- package/LICENSE +21 -0
- package/README.md +37 -2
- package/docs/decisions/decisions.json +861 -0
- package/docs/ontology.json +796 -0
- package/docs/ontology.md +163 -0
- package/docs/reference/ROUTES.md +125 -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 +101 -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/interface/api/server.mjs +69 -0
- package/interface/cli/find-venture.mjs +15 -0
- package/interface/cli/mentura.mjs +271 -0
- package/interface/cli/naive.mjs +169 -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/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/layer.json +31 -0
- package/interface/mcp/server.mjs +122 -0
- package/interface/operator-console/README.md +58 -0
- package/interface/provenance.mjs +42 -0
- package/interface/references/references.json +28 -0
- package/interface/route-aliases.json +32 -0
- package/interface/router.mjs +580 -0
- package/interface/skills/install-mentura/SKILL.md +88 -0
- package/interface/tooling/integrations.json +112 -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/layer.json +42 -0
- package/knowledge/skills/find-reference/SKILL.md +38 -0
- package/knowledge/skills/industry-awareness/SKILL.md +277 -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 +60 -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/recruiting-brief.md +35 -0
- package/operations/tooling/integrations.json +158 -0
- package/package.json +57 -4
- package/packages/catalog.json +272 -0
- package/packages/cofounder/package.json +42 -0
- package/packages/counsel/package.json +47 -0
- package/packages/customers/package.json +21 -0
- package/packages/decisions/package.json +17 -0
- package/packages/engineering/package.json +41 -0
- package/packages/evidence/package.json +17 -0
- package/packages/finance/package.json +48 -0
- package/packages/foundation/package.json +52 -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 +57 -0
- package/packages/money/package.json +21 -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 +99 -0
- package/platform/README.md +45 -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/rho.mjs +145 -0
- package/platform/integrations/site.mjs +75 -0
- package/platform/kits/README.md +7 -0
- package/platform/mcp/research.mjs +64 -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 +179 -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 +61 -0
- package/schema/VERSION +1 -0
- package/schema/account.schema.json +79 -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/bdd.mjs +56 -0
- package/schema/board.schema.json +101 -0
- package/schema/check-boundary.mjs +54 -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 +77 -0
- package/schema/check-nouns.mjs +49 -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 +66 -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 +1258 -0
- package/schema/data-model.schema.json +152 -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 +321 -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/migrate/agent.mjs +12 -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/gate.mjs +39 -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 +98 -0
- package/schema/integration.schema.json +143 -0
- package/schema/knowledge-sources.schema.json +130 -0
- package/schema/layer.json +46 -0
- package/schema/layer.schema.json +119 -0
- package/schema/load-packages.mjs +26 -0
- package/schema/marketing-sitemap.schema.json +232 -0
- package/schema/migrate-venture.mjs +192 -0
- package/schema/need-now.json +601 -0
- package/schema/need-now.mjs +107 -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 +247 -0
- package/schema/payouts.mjs +91 -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/publication-policy.schema.json +293 -0
- package/schema/raw-source.schema.json +15 -0
- package/schema/reference.schema.json +115 -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/site-presence.schema.json +337 -0
- package/schema/strategic-foundation.schema.json +74 -0
- package/schema/stream.schema.json +14 -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/upgrade-venture.mjs +129 -0
- package/schema/use-model.mjs +10 -0
- package/schema/validate.py +49 -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.schema.json +407 -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,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "everything-ecosystem",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "I have a project called another project. It's an organizational structure visualizer — it maps how companies, ecosystems, and institutions are structured. Right now it has an Astro-based web app (org-viz-app) that visualizes Google/Alphabet's corporate structure as a tree. It uses Neo4j for graph data. I also think this tool could be used as an AI-readable source of truth for any company — not just visualizing structure but actually storing and verifying all the entity profiles, decisions, and relationships of an entire ecosystem on something like Git. It could parse conversation logs from Slack or Discord to extract ideas and decisions. I'm not sure if this is just an internal tool for my own ecosystem, or if it's a standalone open source project, or if it could actually be a full product with its own business. Help me figure out what this is.",
|
|
7
|
+
"expected_output": "The AI should run Discovery Mode and recognize the complexity here — another project has multiple potential classifications depending on strategic intent. It could be (a) an internal tool for the user's own ecosystem, (b) an open source tool, or (c) a full subsidiary with product, brand, and business. The AI should walk through the independence test, note that the product pillar is partially built (the viz app exists), the brand is unintentional, and the business is conceptual at best. It should surface the tension between internal tool and potential product, ask clarifying questions about the user's intent, and produce an entity profile that captures the current state and the potential trajectories. It should also identify related concepts like the communication-to-Git pipeline as potential child entities or features.",
|
|
8
|
+
"files": [
|
|
9
|
+
"/sessions/relaxed-kind-albattani/mnt/Documents/projects/<entity>/ENTITY_PROFILE.md"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": 2,
|
|
14
|
+
"prompt": "I want to analyze Tesla's ecosystem. Map out all their major products and entities, classify each one, and show me how they relate to each other. Include things like the vehicles, energy products, Optimus, the Gigafactories, FSD/AI, and Dojo.",
|
|
15
|
+
"expected_output": "The AI should run Analysis Mode, creating an entity inventory of Tesla's major entities, classifying each (vehicles as products within company, Gigafactories as vertical integration/shared infrastructure, Optimus as a product, FSD as a product, Dojo as internal tool/infrastructure, Solar/Powerwall as products). It should map relationships including horizontal, vertical, and diagonal movements (especially Optimus → SpaceX diagonal). Should produce entity profiles and a relationship map.",
|
|
16
|
+
"files": []
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": 3,
|
|
20
|
+
"prompt": "I have an open source JavaScript library that I built. It started as just code on GitHub but now it has 2000 stars, a Discord community of 500 people, and companies are asking me about enterprise support. I'm trying to figure out if this is still just an open source tool or if it's becoming something bigger. What should I do with it?",
|
|
21
|
+
"expected_output": "The AI should recognize this as an entity in transition — it started as an open source tool (product only) but is developing brand (community, recognition) and business (enterprise demand) pillars. It should walk through the independence test, assess each pillar's current state, and help the user decide whether to keep it as an open source tool, develop it into a full company, or something in between. Should produce an entity profile reflecting the current transitional state.",
|
|
22
|
+
"files": []
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "everything-ecosystem",
|
|
3
|
+
"harness_version": "1.0",
|
|
4
|
+
"description": "Testing suite for the Everything Ecosystem agent environment. Validates that the orchestrator routes correctly, system skills operate on the right files, handoff triggers fire, and end-to-end workflows complete with proper provenance.",
|
|
5
|
+
"evals": [
|
|
6
|
+
{
|
|
7
|
+
"id": 1,
|
|
8
|
+
"eval_name": "session-calibration-capture",
|
|
9
|
+
"prompt": "I have a bunch of ideas about a new recipe app I've been thinking about. I just want to get them out of my head.",
|
|
10
|
+
"expected_output": "Orchestrator detects capture session intent. Routes to idea dump system. Ideas are captured with sequential numbering, idea statuses, and provenance metadata. No push toward classification or routing. Routing mode defaults to batch.",
|
|
11
|
+
"systems_invoked": ["orchestrator", "idea-dump"],
|
|
12
|
+
"handoff_files_touched": ["IDEA_DUMP.md"],
|
|
13
|
+
"assertions": [
|
|
14
|
+
{"name": "session-type-detected", "check": "Orchestrator identifies this as a capture session"},
|
|
15
|
+
{"name": "idea-dump-invoked", "check": "Idea dump system skill is read and followed"},
|
|
16
|
+
{"name": "ideas-numbered", "check": "Each idea gets a sequential number"},
|
|
17
|
+
{"name": "statuses-assigned", "check": "Each idea gets an idea status"},
|
|
18
|
+
{"name": "provenance-recorded", "check": "Session date and number recorded as provenance"},
|
|
19
|
+
{"name": "no-premature-routing", "check": "Ideas are not routed during capture; routing is batch"},
|
|
20
|
+
{"name": "no-classification-push", "check": "Framework does not push toward entity classification"}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": 2,
|
|
25
|
+
"eval_name": "entity-discovery-new-project",
|
|
26
|
+
"prompt": "I have a project called BrightPath — it's a mentoring platform that connects experienced professionals with early-career developers. It has a landing page, a matching algorithm, and a Stripe integration. I want to figure out what it is and where it fits.",
|
|
27
|
+
"expected_output": "Orchestrator detects focused session on entity classification. Routes to entity profiling system (discovery mode). A complete entity profile is produced with all 10 sections populated or given field statuses. Documentation audit identifies gaps. Classification is proposed with reasoning, then confirmed with user.",
|
|
28
|
+
"systems_invoked": ["orchestrator", "entity-profiling"],
|
|
29
|
+
"handoff_files_touched": ["ENTITY_PROFILE.md"],
|
|
30
|
+
"assertions": [
|
|
31
|
+
{"name": "discovery-mode-invoked", "check": "Entity profiling system is read; discovery mode process followed"},
|
|
32
|
+
{"name": "all-sections-present", "check": "Entity profile contains all 10 sections"},
|
|
33
|
+
{"name": "no-blanks", "check": "Every field has a value or a field status"},
|
|
34
|
+
{"name": "classification-proposed", "check": "Classification is proposed with reasoning before confirmation"},
|
|
35
|
+
{"name": "pillars-assessed", "check": "Product, brand, and business pillars each have lifecycle stage"},
|
|
36
|
+
{"name": "doc-audit-included", "check": "Documentation audit section identifies existing vs missing docs"},
|
|
37
|
+
{"name": "changelog-entry", "check": "Changelog records profile creation date and trigger"}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": 3,
|
|
42
|
+
"eval_name": "idea-graduation-to-spec",
|
|
43
|
+
"prompt": "Look at the active ideas in the idea dump. Items 147 through 154 are ready to be formalized into a specification document. Graduate them.",
|
|
44
|
+
"expected_output": "Orchestrator routes to idea dump system to identify the ideas, then to design/spec system to produce the spec document. Ideas are marked as implemented in the dump with provenance trails. Entity profile documentation audit is updated. Entity profile is the last file touched.",
|
|
45
|
+
"systems_invoked": ["orchestrator", "idea-dump", "entity-profiling"],
|
|
46
|
+
"handoff_files_touched": ["IDEA_DUMP.md", "spec document (new)", "ENTITY_PROFILE.md"],
|
|
47
|
+
"assertions": [
|
|
48
|
+
{"name": "ideas-identified", "check": "Correct ideas (147-154) are read from the dump"},
|
|
49
|
+
{"name": "spec-created", "check": "A specification document is created with the graduated ideas"},
|
|
50
|
+
{"name": "spec-implementation-ready", "check": "Spec is structured for handoff to implementation agents"},
|
|
51
|
+
{"name": "provenance-recorded", "check": "Each idea gets provenance trail showing graduation to spec"},
|
|
52
|
+
{"name": "ideas-cleared", "check": "Ideas marked as implemented, not left active"},
|
|
53
|
+
{"name": "audit-updated", "check": "Entity profile documentation audit reflects new spec document"},
|
|
54
|
+
{"name": "entity-profile-last", "check": "Entity profile is the last file modified in the workflow"}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": 4,
|
|
59
|
+
"eval_name": "diagnostic-ecosystem-health",
|
|
60
|
+
"prompt": "How is my ecosystem looking? What should I focus on this week?",
|
|
61
|
+
"expected_output": "Orchestrator routes to diagnostic system. Diagnostic reads all idea dumps, entity profiles, and session log. Surfaces implementation lag, inactivity signals, and clustering if present. Produces strategic recommendations linked to specific session types.",
|
|
62
|
+
"systems_invoked": ["orchestrator", "diagnostic"],
|
|
63
|
+
"handoff_files_touched": [],
|
|
64
|
+
"assertions": [
|
|
65
|
+
{"name": "diagnostic-invoked", "check": "Diagnostic system skill is read and followed"},
|
|
66
|
+
{"name": "dumps-analyzed", "check": "All active idea dumps are read and analyzed"},
|
|
67
|
+
{"name": "entity-profiles-checked", "check": "Entity profiles are read for lifecycle status"},
|
|
68
|
+
{"name": "lag-detected-if-present", "check": "Implementation lag is identified if ideas are aging"},
|
|
69
|
+
{"name": "recommendations-actionable", "check": "Recommendations suggest specific session types or actions"},
|
|
70
|
+
{"name": "skeptical-not-praising", "check": "Diagnostic is tuned toward finding problems, not confirming health"},
|
|
71
|
+
{"name": "no-structural-changes", "check": "Diagnostic does not create files or modify structure"}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": 5,
|
|
76
|
+
"eval_name": "routing-batch-session-end",
|
|
77
|
+
"prompt": "I've been dumping ideas all session. Show me what's queued for routing and let me decide where things go.",
|
|
78
|
+
"expected_output": "Orchestrator routes to routing system. Routing system reads the idea dump and entity hierarchy. Presents a visible queue of ideas with suggested targets. For each idea, proposes a destination dump. Waits for user confirmation before executing routes. Provenance chains recorded for each movement.",
|
|
79
|
+
"systems_invoked": ["orchestrator", "routing", "idea-dump"],
|
|
80
|
+
"handoff_files_touched": ["IDEA_DUMP.md (source)", "IDEA_DUMP.md (target)"],
|
|
81
|
+
"assertions": [
|
|
82
|
+
{"name": "routing-invoked", "check": "Routing system skill is read and followed"},
|
|
83
|
+
{"name": "queue-visible", "check": "Queued ideas are presented with suggested targets"},
|
|
84
|
+
{"name": "targets-justified", "check": "Each suggested target is based on entity hierarchy"},
|
|
85
|
+
{"name": "user-confirms-before-move", "check": "No ideas are moved without user confirmation"},
|
|
86
|
+
{"name": "provenance-on-move", "check": "Each routed idea gets provenance chain entries in both dumps"},
|
|
87
|
+
{"name": "metadata-updated", "check": "Dump metadata updated in both source and target dumps"},
|
|
88
|
+
{"name": "dump-to-dump-only", "check": "Ideas route to other dumps, never directly to implementation"}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": 6,
|
|
93
|
+
"eval_name": "return-session-recap",
|
|
94
|
+
"prompt": "Hey, I'm back. What were we working on?",
|
|
95
|
+
"expected_output": "Orchestrator detects return session. Routes to session management for 'Previously on...' recap. Session management reads the most recent session log entry and delivers the recap in the fun show-name format. Transitions to session calibration after recap.",
|
|
96
|
+
"systems_invoked": ["orchestrator", "session-management"],
|
|
97
|
+
"handoff_files_touched": ["SESSION_LOG.md"],
|
|
98
|
+
"assertions": [
|
|
99
|
+
{"name": "return-detected", "check": "Orchestrator identifies this as a return session"},
|
|
100
|
+
{"name": "session-log-read", "check": "Most recent session log entry is read"},
|
|
101
|
+
{"name": "recap-delivered", "check": "Recap is delivered in 'Previously on...' format"},
|
|
102
|
+
{"name": "show-name-used", "check": "A fun show name is used for the recap framing"},
|
|
103
|
+
{"name": "transition-to-calibration", "check": "After recap, orchestrator asks what to work on today"}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": 7,
|
|
108
|
+
"eval_name": "person-profile-creation",
|
|
109
|
+
"prompt": "I'd like to create my person profile. I'm the owner, CEO of the reference project. I'm a developer and systems thinker. I have several projects: Another project (open source, passion), another project (commercial, building), and a news app concept (early exploration).",
|
|
110
|
+
"expected_output": "Orchestrator routes to person profile system. Person profile created with all schema sections. Capacities listed with development levels. Projects listed with commitment type, emotional investment, time horizon, and intended outcome. Context section captures any offhand remarks.",
|
|
111
|
+
"systems_invoked": ["orchestrator", "person-profile"],
|
|
112
|
+
"handoff_files_touched": ["PERSON_PROFILE.md"],
|
|
113
|
+
"assertions": [
|
|
114
|
+
{"name": "person-profile-invoked", "check": "Person profile system skill is read and followed"},
|
|
115
|
+
{"name": "all-sections-present", "check": "Profile contains all schema sections (Identity through Context)"},
|
|
116
|
+
{"name": "capacities-listed", "check": "Developer and systems thinker captured as capacities"},
|
|
117
|
+
{"name": "projects-with-metadata", "check": "Each project has commitment, investment, horizon, outcome"},
|
|
118
|
+
{"name": "ceo-position-noted", "check": "CEO position is distinguished from person capacities"},
|
|
119
|
+
{"name": "changelog-entry", "check": "Changelog records profile creation"}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": 8,
|
|
124
|
+
"eval_name": "multi-modal-session-transitions",
|
|
125
|
+
"prompt": "Let me start by dumping some ideas about a new feature for another project... [ideas]... actually, let me look at the entity profile for another project and update the product pillar... and while we're at it, what does my idea dump backlog look like?",
|
|
126
|
+
"expected_output": "Orchestrator detects multi-modal session. Transitions between systems: idea dump (capture) → entity profiling (review/update) → diagnostic (backlog check). Each transition is tracked. At session end, session log captures sub-session transitions.",
|
|
127
|
+
"systems_invoked": ["orchestrator", "idea-dump", "entity-profiling", "diagnostic", "session-management"],
|
|
128
|
+
"handoff_files_touched": ["IDEA_DUMP.md", "ENTITY_PROFILE.md", "SESSION_LOG.md"],
|
|
129
|
+
"assertions": [
|
|
130
|
+
{"name": "multi-modal-detected", "check": "Orchestrator recognizes multi-modal session"},
|
|
131
|
+
{"name": "transitions-tracked", "check": "Each system transition is noted by the orchestrator"},
|
|
132
|
+
{"name": "idea-capture-correct", "check": "Ideas captured properly during capture phase"},
|
|
133
|
+
{"name": "entity-profile-updated", "check": "Entity profile updated during review phase"},
|
|
134
|
+
{"name": "diagnostic-runs", "check": "Diagnostic provides backlog analysis when requested"},
|
|
135
|
+
{"name": "session-log-captures-transitions", "check": "Session log entry notes the sub-session type shifts"},
|
|
136
|
+
{"name": "audit-trigger-fires", "check": "Entity profile audit updated after any document changes"}
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"layer": "evidence",
|
|
3
|
+
"purpose": "Prove what is true: results of running checks, eval suites, benchmarks, and audits of coverage, fidelity, findability and metrics.",
|
|
4
|
+
"skills": [
|
|
5
|
+
{
|
|
6
|
+
"id": "design-coverage",
|
|
7
|
+
"path": "evidence/skills/design-coverage/SKILL.md"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "fidelity-ladder-audit",
|
|
11
|
+
"path": "evidence/skills/fidelity-ladder-audit/SKILL.md"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "findability",
|
|
15
|
+
"path": "evidence/skills/findability/SKILL.md"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "foreshadowing-audit",
|
|
19
|
+
"path": "evidence/skills/foreshadowing-audit/SKILL.md"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "metrics-review",
|
|
23
|
+
"path": "evidence/skills/metrics-review/SKILL.md"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "agent-capabilities",
|
|
27
|
+
"path": "evidence/skills/agent-capabilities/SKILL.md"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"records": [
|
|
31
|
+
"evidence",
|
|
32
|
+
"eval-suite",
|
|
33
|
+
"design-documents-registry",
|
|
34
|
+
"benchmark",
|
|
35
|
+
"agent-capability"
|
|
36
|
+
],
|
|
37
|
+
"reads": [
|
|
38
|
+
"handoff",
|
|
39
|
+
"design-document",
|
|
40
|
+
"venture-profile",
|
|
41
|
+
"decision"
|
|
42
|
+
],
|
|
43
|
+
"writes": [],
|
|
44
|
+
"checks": [
|
|
45
|
+
"evidence/skills/design-coverage/check.mjs"
|
|
46
|
+
],
|
|
47
|
+
"gaps": [
|
|
48
|
+
"Audits (coverage, fidelity, findability) print reports but do not write evidence records"
|
|
49
|
+
],
|
|
50
|
+
"name": "evidence"
|
|
51
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: knowledge
|
|
3
|
+
tags: [everything-ecosystem, skills, evidence, agents, capabilities, research]
|
|
4
|
+
ai-model: claude-opus-5.5
|
|
5
|
+
created: 2026-10-27T20:45:13Z
|
|
6
|
+
source: hybrid
|
|
7
|
+
name: agent-capabilities
|
|
8
|
+
description: >
|
|
9
|
+
Keep the agent capability register current: what agents can, cannot, may not,
|
|
10
|
+
or are not yet known to do, task by task, with sources and dates. Add entries
|
|
11
|
+
from new research and from our own evals; team plans read it to place human
|
|
12
|
+
loops (EE-029).
|
|
13
|
+
MANDATORY TRIGGERS: can an agent do, agent capability, what can AI do, human
|
|
14
|
+
in the loop, is this safe to delegate, new model release, agent benchmark,
|
|
15
|
+
eval result, update the capability register.
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Agent capabilities
|
|
19
|
+
|
|
20
|
+
Evidence layer (EE-029). Writes `evidence/capabilities/agent-capabilities.json`; `schema/check-team.mjs` checks it.
|
|
21
|
+
|
|
22
|
+
## Why
|
|
23
|
+
|
|
24
|
+
The research on what agents can do is new and changes month to month. Without a dated register, every team plan guesses. With it, a gap becomes a question to research or an eval to run.
|
|
25
|
+
|
|
26
|
+
## Adding or updating an entry
|
|
27
|
+
|
|
28
|
+
1. **Task:** one task, worded as work in a venture ("hold sales conversations with buyers"), with its layer or tier.
|
|
29
|
+
2. **Status:** `can`, `can-with-review`, `cannot`, `not-allowed` (decision rights or law reserve it to a person; cite the class) or `unknown`.
|
|
30
|
+
3. **Basis:** a source fetched and dated (`find-reference`), or our own eval result file. No basis means `unknown`.
|
|
31
|
+
4. **Re-check** entries with a URL after six months, and whenever a new model is adopted.
|
|
32
|
+
|
|
33
|
+
## Producing evidence ourselves
|
|
34
|
+
|
|
35
|
+
When a team plan puts a person in the loop for an `unknown` task, turn the task into an eval: the agent does it beside the person on real work, both results are recorded in `evidence/results/`, and the entry is updated from them.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-coverage
|
|
3
|
+
description: "Check which design documents (domain, product, experience, interface, systems) exist for any project and flag gaps, using the registry in evidence/design-documents.registry.json and each entity's design-profile. Run --quick at every SAD session opening (PART 4 step 4b) for the entity in scope; deep (TypeSafe) at phase gates. Use whenever the owner says \"domain design\", \"systems design\", \"capability map\", \"categories\", \"product architecture\", \"user experience\", \"UX\", \"UI\", \"interface\", \"front-end contract\", or asks what docs are missing. MANDATORY TRIGGERS: session start on any project, domain design, systems design, capability map, design docs, what are we missing, design coverage, gaps."
|
|
4
|
+
type: skill
|
|
5
|
+
source: hybrid
|
|
6
|
+
created: 2026-10-09
|
|
7
|
+
ai-model: claude-opus-5.5
|
|
8
|
+
tags: [skill, sad-v3, domain-design, systems-design, typesafe]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# design-coverage
|
|
12
|
+
|
|
13
|
+
Method: [[DOMAIN_AND_SYSTEMS_DESIGN_METHOD]]. Registry: `evidence/design-documents.registry.json`.
|
|
14
|
+
|
|
15
|
+
## When the owner says…
|
|
16
|
+
|
|
17
|
+
- **"domain design"** → work in `DD-*` documents for the named scope. Say so.
|
|
18
|
+
- **"systems design"** → first confirm domain readiness (DD-04, DD-05, DD-06 exist; DD-10 or DD-11 shows they hold). If not ready, say so and propose finishing the domain first. If ready, produce the full `SD-*` package for the next phase to be built, an outline (SD-04, SD-05, SD-21) for the phase after, nothing further.
|
|
19
|
+
- Always state which layer the work is in and how it relates to the other.
|
|
20
|
+
|
|
21
|
+
## Run the checker
|
|
22
|
+
|
|
23
|
+
**Layers (SAD v3.0.14):** domain (DD) → product (PA) → experience (XD) → interface (UI) → systems (SD). Experience and interface are active by default; an entity with no human users declares `n/a` with the reason. A candidate needs a strong signal (title pattern in file name or title, a heading naming the ID, or a path match).
|
|
24
|
+
|
|
25
|
+
**At every session opening on a project (SAD v3.0.13, PART 4 step 4b), quick, free:**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
node evidence/skills/design-coverage/check.mjs --entity <vault>/projects/<entity> --quick
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Read `<entity>/_meta/design-coverage/latest-quick.md`. Tell the owner, in one or two lines, which required documents bearing on today's task have no candidate (✗), and if the entity has no `design-profile`, say that first: it's the gap that hides the others. Don't start design work that depends on a missing document without writing it first or recording why not.
|
|
32
|
+
|
|
33
|
+
**Deep (TypeSafe) at phase gates, before ratification, or when candidates need judging:**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
node --env-file=<env file that sets TYPESAFE_API_KEY> evidence/skills/design-coverage/check.mjs --entity <vault>/projects/<entity>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Vault-wide** (campaign start): `node evidence/skills/design-coverage/scan.mjs` writes `<vault>/_meta/design-coverage/STATUS.md`.
|
|
40
|
+
|
|
41
|
+
**Explicit mode** (a scope that isn't one entity): `--root <dir> [--root …] [--include '<regex>'] --characteristics … --obligations … [--entity-class business] [--layer domain|product|system|all] --out <prefix>`.
|
|
42
|
+
|
|
43
|
+
**Declaring a design profile** (when missing): add the `design-profile:` block to the entity profile (schema in `references/entity-profile-schema.md`): ARS characteristics and obligations, extra roots, `systems-design: active | not-started | n/a`. Propose values from the profile and mark them `declared: "<date>, proposed by <model>; confirm"` until the owner confirms.
|
|
44
|
+
|
|
45
|
+
Writes `<prefix>.json` (per document: status, answered/total, unanswered questions, candidates) and `<prefix>.md` (table). Characteristics and obligations come from the scope's Asset Requirement Set; documents whose `required_when` isn't met are `not_applicable`. Never print the API key.
|
|
46
|
+
|
|
47
|
+
## Layers
|
|
48
|
+
|
|
49
|
+
- **Domain (DD-01..12):** includes the **capability map (DD-12)**, required for every project: categories by job, core / supporting / generic, build or integrate, dependencies, owners, success measures.
|
|
50
|
+
- **Product (PA-01..03):** structure and naming (C-19), packaging and buyer mapping, competitive landscape by category (businesses).
|
|
51
|
+
- **Systems (SD-01..23):** only when `systems-design: active`.
|
|
52
|
+
|
|
53
|
+
## Interpreting
|
|
54
|
+
|
|
55
|
+
- Deep: `exists` ≥ 80% of questions answered; `partial` ≥ 20%; `null` otherwise. Quick: `candidate` (judge it with a deep run) or `null` (nothing found).
|
|
56
|
+
- `not_started`: systems design hasn't begun for this entity; `not_applicable`: the document's `required_when` isn't met.
|
|
57
|
+
- Treat results as evidence for review: a concept spread over several files can read `partial`. Confirm by reading the unanswered questions.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// design-coverage: which design documents (domain, product, experience, interface, systems) exist for a scope, and which are missing.
|
|
2
|
+
// Registry: evidence/design-documents.registry.json
|
|
3
|
+
//
|
|
4
|
+
// Entity mode (normal use; reads the entity profile's `design-profile:` block):
|
|
5
|
+
// node check.mjs --entity <vault entity folder> [--quick]
|
|
6
|
+
// Explicit mode:
|
|
7
|
+
// node --env-file=<repo>/.env.local check.mjs --root <dir> [--root <dir> ...] [--include <regex>]
|
|
8
|
+
// [--characteristics C-01,...] [--obligations O-01,...] [--entity-class business] [--layer domain|product|experience|interface|system|all] [--out <prefix>] [--quick]
|
|
9
|
+
//
|
|
10
|
+
// --quick: no model calls, no key, no cost. Finds candidate documents by filename, title, headings and frontmatter
|
|
11
|
+
// type; reports `candidate` (something to check) or `null` (nothing found). For session start.
|
|
12
|
+
// deep (default): TypeSafe (Jev) judges, per registry question, whether the best candidates answer it.
|
|
13
|
+
// Status: exists (>=80% answered) · partial (>=20%) · null · not_applicable (required_when not met) · not_started.
|
|
14
|
+
import { readFileSync, writeFileSync, readdirSync, statSync, existsSync, mkdirSync } from "node:fs";
|
|
15
|
+
import { join, basename, dirname, resolve } from "node:path";
|
|
16
|
+
import { createHash } from "node:crypto";
|
|
17
|
+
import { homedir } from "node:os";
|
|
18
|
+
|
|
19
|
+
const HERE = dirname(new URL(import.meta.url).pathname);
|
|
20
|
+
const REG = JSON.parse(readFileSync(join(HERE, "../../design-documents.registry.json"), "utf8"));
|
|
21
|
+
const MODEL = "jev-1.13.0";
|
|
22
|
+
const args = process.argv.slice(2);
|
|
23
|
+
const opt = (k, d) => { const i = args.indexOf(k); return i >= 0 ? args[i + 1] : d; };
|
|
24
|
+
const flag = (k) => args.includes(k);
|
|
25
|
+
const home = (p) => p.replace(/^~(?=\/|$)/, homedir());
|
|
26
|
+
const tilde = (p) => p.replace(homedir(), "~");
|
|
27
|
+
const quick = flag("--quick");
|
|
28
|
+
|
|
29
|
+
// ---------- the design profile ----------
|
|
30
|
+
/** Reads `design-profile:` from an entity profile's frontmatter (a small, fixed shape; no YAML dependency). */
|
|
31
|
+
export function readDesignProfile(entityDir) {
|
|
32
|
+
const p = join(entityDir, "entity-profile.md");
|
|
33
|
+
if (!existsSync(p)) return { found: false, why: "no entity-profile.md" };
|
|
34
|
+
const t = readFileSync(p, "utf8");
|
|
35
|
+
const fm = t.startsWith("---") ? t.slice(3, t.indexOf("\n---", 3)) : "";
|
|
36
|
+
const entityClass = (fm.match(/^entity-class:\s*([\w-]+)/m) || [])[1];
|
|
37
|
+
const name = (t.match(/^#\s+(.+)$/m) || [])[1] ?? basename(entityDir);
|
|
38
|
+
const i = fm.search(/^design-profile:\s*(#.*)?$/m);
|
|
39
|
+
if (i < 0) return { found: false, entityClass, name, why: "design-profile not declared in entity-profile.md" };
|
|
40
|
+
const dp = {};
|
|
41
|
+
for (const line of fm.slice(i).split("\n").slice(1)) {
|
|
42
|
+
if (!/^\s{2,}\S/.test(line)) break;
|
|
43
|
+
const m = line.match(/^\s+([\w-]+):\s*(.*)$/); if (!m) continue;
|
|
44
|
+
let v = m[2].trim().replace(/\s+#.*$/, "");
|
|
45
|
+
dp[m[1]] = v.startsWith("[") ? v.slice(1, -1).split(",").map((x) => x.trim().replace(/^["']|["']$/g, "")).filter(Boolean) : v.replace(/^["']|["']$/g, "");
|
|
46
|
+
}
|
|
47
|
+
return { found: true, entityClass, name, ...dp };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const entityDir = opt("--entity") ? resolve(home(opt("--entity"))) : null;
|
|
51
|
+
const profile = entityDir ? readDesignProfile(entityDir) : null;
|
|
52
|
+
const listArg = (k) => (opt(k, "") || "").split(",").filter(Boolean);
|
|
53
|
+
const roots = [
|
|
54
|
+
...(entityDir ? [entityDir] : []),
|
|
55
|
+
...((profile?.roots ?? []).map(home)),
|
|
56
|
+
...args.flatMap((a, i) => (a === "--root" ? [home(args[i + 1])] : [])),
|
|
57
|
+
].filter((r) => existsSync(r));
|
|
58
|
+
const includeSrc = opt("--include") ?? (profile?.include || null);
|
|
59
|
+
const include = includeSrc ? new RegExp(includeSrc) : null;
|
|
60
|
+
const chars = new Set(listArg("--characteristics").length ? listArg("--characteristics") : profile?.characteristics ?? []);
|
|
61
|
+
const obls = new Set(listArg("--obligations").length ? listArg("--obligations") : profile?.obligations ?? []);
|
|
62
|
+
const entityClass = opt("--entity-class") ?? profile?.entityClass ?? "";
|
|
63
|
+
const systemsDesign = profile?.["systems-design"] ?? (entityDir ? "not-started" : "active"); // active | not-started | n/a
|
|
64
|
+
// Experience and interface design apply to anything people use; they are active unless the profile says n/a (no human users)
|
|
65
|
+
// or not-started. Default active so their gaps are visible (SAD v3.0.14).
|
|
66
|
+
const layerState = { system: systemsDesign, experience: profile?.["experience-design"] ?? "active", interface: profile?.["interface-design"] ?? "active" };
|
|
67
|
+
const layer = opt("--layer", "all");
|
|
68
|
+
const outDefault = entityDir ? join(entityDir, "_meta", "design-coverage", quick ? "latest-quick" : "latest") : "design-coverage";
|
|
69
|
+
const out = opt("--out", outDefault);
|
|
70
|
+
if (!roots.length) { console.error("need --entity <dir> or --root <dir>"); process.exit(1); }
|
|
71
|
+
if (!quick && !process.env.TYPESAFE_API_KEY) { console.error("deep check needs TYPESAFE_API_KEY (run with --env-file), or use --quick"); process.exit(2); }
|
|
72
|
+
|
|
73
|
+
// ---------- collect documents ----------
|
|
74
|
+
function walk(d, top, acc = []) {
|
|
75
|
+
for (const n of readdirSync(d)) {
|
|
76
|
+
if (n.startsWith(".") || ["node_modules", "_archive", "dist", "build", ".next", "data", "_meta"].includes(n)) continue;
|
|
77
|
+
const p = join(d, n); let s; try { s = statSync(p); } catch { continue; }
|
|
78
|
+
if (s.isDirectory()) {
|
|
79
|
+
// In entity mode, a nested child entity is its own scope.
|
|
80
|
+
if (entityDir && p !== top && existsSync(join(p, "entity-profile.md")) && !include) continue;
|
|
81
|
+
walk(p, top, acc);
|
|
82
|
+
} else if (/\.(md|json|ya?ml)$/i.test(n) && s.size < 2_000_000 && (!include || include.test(p))) acc.push(p);
|
|
83
|
+
}
|
|
84
|
+
return acc;
|
|
85
|
+
}
|
|
86
|
+
const files = roots.flatMap((r) => walk(r, r)).map((p) => {
|
|
87
|
+
const t = readFileSync(p, "utf8");
|
|
88
|
+
const fm = t.startsWith("---") ? t.slice(3, t.indexOf("\n---", 3)) : "";
|
|
89
|
+
const type = (fm.match(/^type:\s*(.+)$/m) || [])[1]?.trim() ?? "";
|
|
90
|
+
const title = (t.match(/^#\s+(.+)$/m) || [])[1] ?? basename(p);
|
|
91
|
+
const heads = [...t.matchAll(/^#{2,3}\s+(.+)$/gm)].map((m) => m[1]).join(" | ");
|
|
92
|
+
return { path: p, type, title, heads, text: t };
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
function score(doc, f) {
|
|
96
|
+
const hay = `${basename(f.path)} ${f.title} ${f.heads}`.toLowerCase();
|
|
97
|
+
let s = 0;
|
|
98
|
+
for (const t of doc.evidence.title_patterns) if (hay.includes(t.toLowerCase())) s += 2;
|
|
99
|
+
if (doc.evidence.frontmatter_types.includes(f.type)) s += 1;
|
|
100
|
+
if (new RegExp(`\\b${doc.id}\\b`, "i").test(`${f.title} ${f.heads}`)) s += 4; // a title or heading that names the id claims to answer it
|
|
101
|
+
for (const g of doc.evidence.path_globs) { const re = new RegExp(g.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*\//g, "(.*/)?").replace(/\*/g, "[^/]*")); if (re.test(f.path)) s += 3; }
|
|
102
|
+
for (const q of doc.questions) for (const w of q.text.toLowerCase().match(/[a-z]{6,}/g) || []) if (f.heads.toLowerCase().includes(w)) s += 0.2;
|
|
103
|
+
return s;
|
|
104
|
+
}
|
|
105
|
+
// A candidate needs a strong signal: a title pattern in the name, title or headings, a heading naming the id, or a path match.
|
|
106
|
+
// A frontmatter type and shared question words alone matched unrelated documents (SAD v3.0.14 audit: 12 of 18 false).
|
|
107
|
+
function strong(doc, f) {
|
|
108
|
+
const name = `${basename(f.path).replace(/[_-]+/g, " ")} ${f.title}`.toLowerCase(); // headings are too noisy for a strong signal
|
|
109
|
+
if (doc.evidence.title_patterns.some((t) => name.includes(t.toLowerCase()))) return true;
|
|
110
|
+
if (new RegExp(`\\b${doc.id}\\b`, "i").test(`${f.title} ${f.heads}`)) return true; // the id in the title or a heading
|
|
111
|
+
return doc.evidence.path_globs.some((g) => new RegExp(g.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*\//g, "(.*/)?").replace(/\*/g, "[^/]*")).test(f.path));
|
|
112
|
+
}
|
|
113
|
+
function required(doc) {
|
|
114
|
+
const st = layerState[doc.layer];
|
|
115
|
+
if (st && st !== "active") return { ok: false, status: st === "n/a" ? "not_applicable" : "not_started", why: st === "n/a" ? `${doc.layer} design not applicable to this entity` : `${doc.layer} design not started (design-profile ${doc.layer}-design)` };
|
|
116
|
+
const r = doc.required_when;
|
|
117
|
+
if (r === "always" || !r.includes(":")) return { ok: true, why: r };
|
|
118
|
+
const [k, v] = r.split(":"); const want = v.split("|");
|
|
119
|
+
const have = k === "characteristics" ? chars : k === "obligations" ? obls : k === "entity-class" ? new Set([entityClass]) : new Set();
|
|
120
|
+
return want.some((w) => have.has(w)) ? { ok: true, why: r } : { ok: false, status: "not_applicable", why: r };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// ---------- TypeSafe ----------
|
|
124
|
+
const cachePath = `${out.replace(/latest(-quick)?$/, "")}typesafe-cache.json`;
|
|
125
|
+
mkdirSync(dirname(out), { recursive: true });
|
|
126
|
+
const cache = !quick && existsSync(cachePath) ? JSON.parse(readFileSync(cachePath, "utf8")) : {};
|
|
127
|
+
let tokens = 0;
|
|
128
|
+
async function ask(state, questions) {
|
|
129
|
+
const k = createHash("sha256").update(JSON.stringify({ state, questions })).digest("hex");
|
|
130
|
+
if (cache[k]) return cache[k];
|
|
131
|
+
for (let a = 0; a < 5; a++) {
|
|
132
|
+
const res = await fetch("https://api.typesafe.ai/v1/systemone", { method: "POST",
|
|
133
|
+
headers: { authorization: `Bearer ${process.env.TYPESAFE_API_KEY}`, "content-type": "application/json" },
|
|
134
|
+
body: JSON.stringify({ model: MODEL, state, questions }), signal: AbortSignal.timeout(90000) });
|
|
135
|
+
if (res.status === 429 || res.status >= 500) { await new Promise((r) => setTimeout(r, 2500 * (a + 1))); continue; }
|
|
136
|
+
if (!res.ok) throw new Error(`TypeSafe ${res.status}`);
|
|
137
|
+
const o = await res.json(); tokens += o.usage?.input_tokens ?? 0; cache[k] = o; return o;
|
|
138
|
+
}
|
|
139
|
+
throw new Error("retries exhausted");
|
|
140
|
+
}
|
|
141
|
+
function excerpt(f, doc) {
|
|
142
|
+
const t = f.text; const keep = [f.title, f.heads];
|
|
143
|
+
const words = [...doc.evidence.title_patterns, doc.id].map((w) => w.toLowerCase());
|
|
144
|
+
for (const s of t.split(/\n(?=#{2,3}\s)/)) if (words.some((w) => s.slice(0, 200).toLowerCase().includes(w))) keep.push(s);
|
|
145
|
+
keep.push(t.slice(0, 4000));
|
|
146
|
+
return keep.join("\n\n").slice(0, 9000);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const docs = REG.documents.filter((d) => layer === "all" || d.layer === layer);
|
|
150
|
+
const results = [];
|
|
151
|
+
for (const doc of docs) {
|
|
152
|
+
const base = { id: doc.id, name: doc.name, layer: doc.layer, stage: doc.stage };
|
|
153
|
+
const req = required(doc);
|
|
154
|
+
if (!req.ok) { results.push({ ...base, status: req.status, reason: req.why, candidates: [] }); continue; }
|
|
155
|
+
const cands = files.map((f) => ({ f, s: score(doc, f) })).filter((x) => x.s >= 2 && strong(doc, x.f)).sort((a, b) => b.s - a.s).slice(0, 3);
|
|
156
|
+
if (!cands.length) { results.push({ ...base, status: "null", answered: 0, total: doc.questions.length, unanswered: doc.questions.map((q) => q.text), candidates: [] }); continue; }
|
|
157
|
+
if (quick) { results.push({ ...base, status: "candidate", total: doc.questions.length, candidates: cands.map(({ f, s }) => ({ path: tilde(f.path), match_score: +s.toFixed(1) })) }); continue; }
|
|
158
|
+
const answered = new Array(doc.questions.length).fill(0); const per = [];
|
|
159
|
+
for (const { f, s } of cands) {
|
|
160
|
+
const r = await ask({ document_path: tilde(f.path), document_excerpt: excerpt(f, doc) },
|
|
161
|
+
Object.fromEntries(doc.questions.map((q, i) => [`q${i}`, { type: "noul",
|
|
162
|
+
instructions: `Does \`document_excerpt\` give a specific, written answer to this design question: "${q.text}"? A heading or a passing mention is not an answer.`,
|
|
163
|
+
criteria: { true: "Yes, it answers it specifically", false: "No, or only vaguely" } }])));
|
|
164
|
+
const vals = doc.questions.map((_, i) => r.answers[`q${i}`].noul);
|
|
165
|
+
vals.forEach((v, i) => { answered[i] = Math.max(answered[i], v); });
|
|
166
|
+
per.push({ path: tilde(f.path), match_score: +s.toFixed(1), answers: vals.map((v) => +v.toFixed(2)) });
|
|
167
|
+
}
|
|
168
|
+
const n = answered.filter((v) => v > 0.5).length, frac = n / doc.questions.length;
|
|
169
|
+
results.push({ ...base, status: frac >= 0.8 ? "exists" : frac >= 0.2 ? "partial" : "null", answered: n, total: doc.questions.length,
|
|
170
|
+
unanswered: doc.questions.filter((_, i) => answered[i] <= 0.5).map((q) => q.text), candidates: per });
|
|
171
|
+
}
|
|
172
|
+
if (!quick) writeFileSync(cachePath, JSON.stringify(cache));
|
|
173
|
+
|
|
174
|
+
const required_ = results.filter((r) => !["not_applicable", "not_started"].includes(r.status));
|
|
175
|
+
const gaps = required_.filter((r) => r.status !== "exists" && r.status !== "candidate");
|
|
176
|
+
const report = { generated: new Date().toISOString(), mode: quick ? "quick" : "deep", model: quick ? null : MODEL, registry: REG.version,
|
|
177
|
+
entity: entityDir ? { path: tilde(entityDir), name: profile?.name, entityClass, designProfile: profile?.found ? "declared" : profile?.why, systemsDesign, experienceDesign: layerState.experience, interfaceDesign: layerState.interface } : null,
|
|
178
|
+
roots: roots.map(tilde), include: include?.source ?? null, characteristics: [...chars], obligations: [...obls],
|
|
179
|
+
tokens, usd: +((tokens / 1e6) * 0.042).toFixed(4),
|
|
180
|
+
summary: Object.fromEntries(["exists", "partial", "candidate", "null", "not_started", "not_applicable"].map((s) => [s, results.filter((r) => r.status === s).length])),
|
|
181
|
+
gaps: gaps.map((g) => `${g.id} ${g.name}: ${g.status}`), results };
|
|
182
|
+
writeFileSync(`${out}.json`, JSON.stringify(report, null, 1));
|
|
183
|
+
const sym = { exists: "✓", partial: "↺", null: "✗", candidate: "?", not_applicable: "N/A", not_started: "—" };
|
|
184
|
+
const md = [
|
|
185
|
+
`# Design coverage${profile?.name ? `: ${profile.name}` : ""} (${report.generated.slice(0, 10)}, ${report.mode})`, "",
|
|
186
|
+
...(profile && !profile.found ? [`> **Gap: ${profile.why}.** Declare it (SAD v3.0.13) so the right documents are required; until then only documents required for every scope are checked.`, ""] : []),
|
|
187
|
+
`Registry ${REG.version} · roots: ${report.roots.join(", ")}${report.include ? ` · include /${report.include}/` : ""} · entity-class: ${entityClass || "—"} · characteristics: ${[...chars].join(", ") || "none"} · obligations: ${[...obls].join(", ") || "none"} · systems: ${systemsDesign} · experience: ${layerState.experience} · interface: ${layerState.interface}${quick ? " · quick (no model calls; `?` = a candidate exists, run deep to judge it)" : ` · TypeSafe ${MODEL}, ≈$${report.usd}`}`, "",
|
|
188
|
+
`**Summary:** ${Object.entries(report.summary).filter(([, v]) => v).map(([k, v]) => `${sym[k]} ${k} ${v}`).join(" · ")}`, "",
|
|
189
|
+
"| ID | Document | Stage | Status | Answered | Best candidate |", "|---|---|---|---|---|---|",
|
|
190
|
+
...results.map((r) => `| ${r.id} | ${r.name} | ${r.stage} | ${sym[r.status]} ${r.status} | ${r.answered !== undefined && r.total ? `${r.answered}/${r.total}` : "—"} | ${r.candidates?.[0]?.path.split("/").pop() ?? (r.reason ?? "")} |`)];
|
|
191
|
+
writeFileSync(`${out}.md`, md.join("\n") + "\n");
|
|
192
|
+
console.log(JSON.stringify({ out: tilde(out), mode: report.mode, summary: report.summary, gaps: report.gaps.length, usd: report.usd }));
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Vault-wide design coverage: quick check (no model calls) on every live entity; writes _meta/design-coverage/STATUS.md.
|
|
2
|
+
// Usage: node scan.mjs [--vault <vault root>]
|
|
3
|
+
import { readdirSync, existsSync, statSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
4
|
+
import { join, dirname, relative } from "node:path";
|
|
5
|
+
import { execFileSync } from "node:child_process";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
|
|
8
|
+
const HERE = dirname(new URL(import.meta.url).pathname);
|
|
9
|
+
const vault = (process.argv[process.argv.indexOf("--vault") + 1] && process.argv.includes("--vault")) ? process.argv[process.argv.indexOf("--vault") + 1].replace(/^~/, homedir()) : join(homedir(), "workspace", "vault");
|
|
10
|
+
const entities = [];
|
|
11
|
+
function find(d, depth) {
|
|
12
|
+
if (depth > 5) return;
|
|
13
|
+
for (const n of readdirSync(d)) {
|
|
14
|
+
if (n.startsWith(".") || n.startsWith("_") || n === "node_modules") continue;
|
|
15
|
+
const p = join(d, n); if (!statSync(p).isDirectory()) continue;
|
|
16
|
+
if (existsSync(join(p, "entity-profile.md"))) {
|
|
17
|
+
const fm = readFileSync(join(p, "entity-profile.md"), "utf8").split("\n---")[0];
|
|
18
|
+
if (!/^entity-status:\s*archived/m.test(fm) && !/^entity-lifecycle-stage:\s*archived/m.test(fm)) entities.push(p);
|
|
19
|
+
}
|
|
20
|
+
find(p, depth + 1);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
for (const root of ["companies", "projects"]) find(join(vault, root), 0);
|
|
24
|
+
|
|
25
|
+
const rows = [];
|
|
26
|
+
for (const e of entities) {
|
|
27
|
+
try {
|
|
28
|
+
const out = execFileSync("node", [join(HERE, "check.mjs"), "--entity", e, "--quick"], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
|
|
29
|
+
const r = JSON.parse(readFileSync(join(e, "_meta", "design-coverage", "latest-quick.json"), "utf8"));
|
|
30
|
+
rows.push({ e: relative(vault, e), r });
|
|
31
|
+
} catch (err) { rows.push({ e: relative(vault, e), err: String(err.message).slice(0, 120) }); }
|
|
32
|
+
}
|
|
33
|
+
const declared = rows.filter((x) => x.r?.entity?.designProfile === "declared").length;
|
|
34
|
+
const md = [
|
|
35
|
+
"---", "type: diagnostic", "source: machine", `created: ${new Date().toISOString().slice(0, 10)}`, "ai-model: none", "tags: [design-coverage, diagnostic, sad-v3]",
|
|
36
|
+
'description: "Vault-wide design coverage (quick mode): for every live entity, which required design documents have no candidate at all. Generated by evidence/skills/design-coverage/scan.mjs; regenerate, do not edit."', "---", "",
|
|
37
|
+
`# Design coverage across the vault (${new Date().toISOString().slice(0, 10)})`, "",
|
|
38
|
+
`Quick mode: no model calls. **✗ null** means no candidate document was found for a required design document; **?** means a candidate exists and a deep check is needed to judge it. ${declared} of ${rows.length} entities declare a \`design-profile\` (SAD v3.0.13); undeclared entities are checked only against documents required for every scope.`, "",
|
|
39
|
+
"| Entity | Class | Profile | ✗ null | ? candidate | Missing (first 6) |", "|---|---|---|---|---|---|",
|
|
40
|
+
...rows.sort((a, b) => (b.r?.summary.null ?? 0) - (a.r?.summary.null ?? 0)).map(({ e, r, err }) => err ? `| ${e} | — | error | — | — | ${err} |`
|
|
41
|
+
: `| [[${e.split("/").pop()}/entity-profile\\|${e}]] | ${r.entity.entityClass ?? "—"} | ${r.entity.designProfile === "declared" ? "declared" : "**not declared**"} | ${r.summary.null} | ${r.summary.candidate} | ${r.results.filter((x) => x.status === "null").slice(0, 6).map((x) => x.id).join(", ")} |`),
|
|
42
|
+
];
|
|
43
|
+
mkdirSync(join(vault, "_meta", "design-coverage"), { recursive: true });
|
|
44
|
+
writeFileSync(join(vault, "_meta", "design-coverage", "STATUS.md"), md.join("\n") + "\n");
|
|
45
|
+
console.log(JSON.stringify({ entities: rows.length, declared, out: "_meta/design-coverage/STATUS.md" }));
|