mirai-graph 1.0.0-rc.1
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/CHANGELOG.md +376 -0
- package/CITATION.cff +20 -0
- package/LICENSE +21 -0
- package/LICENSE-DOCS +26 -0
- package/README.md +270 -0
- package/ROADMAP.md +225 -0
- package/benchmarks/protocols/measure-convert-optimize.md +131 -0
- package/benchmarks/synthetic-context-reduction-v0/README.md +70 -0
- package/benchmarks/synthetic-context-reduction-v0/RESULT.md +52 -0
- package/benchmarks/synthetic-context-reduction-v0/expected/context-pack-compact.md +31 -0
- package/benchmarks/synthetic-context-reduction-v0/gates/results.json +12 -0
- package/benchmarks/synthetic-context-reduction-v0/graph/objects.json +114 -0
- package/benchmarks/synthetic-context-reduction-v0/graph/relations.json +74 -0
- package/benchmarks/synthetic-context-reduction-v0/metrics/example-metrics.json +22 -0
- package/benchmarks/synthetic-context-reduction-v0/mirai-graph-package.json +14 -0
- package/benchmarks/synthetic-context-reduction-v0/results/baseline-comparison-result.json +42 -0
- package/benchmarks/synthetic-context-reduction-v0/results/context-pack.json +181 -0
- package/benchmarks/synthetic-context-reduction-v0/results/context-reduction-result.json +8 -0
- package/benchmarks/synthetic-context-reduction-v0/results/profile-conformance-result.json +28 -0
- package/benchmarks/synthetic-context-reduction-v0/results/readiness-score.json +24 -0
- package/benchmarks/synthetic-context-reduction-v0/reviews/semantic-completeness-review.json +78 -0
- package/benchmarks/synthetic-context-reduction-v0/scripts/calculate-context-reduction.js +42 -0
- package/benchmarks/synthetic-context-reduction-v0/source-corpus/audit-events.md +8 -0
- package/benchmarks/synthetic-context-reduction-v0/source-corpus/content-workflow.md +8 -0
- package/benchmarks/synthetic-context-reduction-v0/source-corpus/identity-access.md +8 -0
- package/benchmarks/synthetic-context-reduction-v0/source-corpus/notification-delivery.md +8 -0
- package/benchmarks/synthetic-context-reduction-v0/tasks/tasks.json +31 -0
- package/docs/adoption/adopter-kit.md +179 -0
- package/docs/adoption/ai-employee-graph.md +151 -0
- package/docs/adoption/character-layer.md +196 -0
- package/docs/adoption/choose-profile.md +98 -0
- package/docs/adoption/cli.md +78 -0
- package/docs/adoption/developer-integration-guide.md +93 -0
- package/docs/adoption/end-to-end-control-loop.md +168 -0
- package/docs/adoption/getting-started.md +169 -0
- package/docs/adoption/mirai-graph-transition.md +64 -0
- package/docs/adoption/profile-conformance-fixtures.md +112 -0
- package/docs/adoption/seed-to-validated-package.md +121 -0
- package/docs/concept.md +109 -0
- package/docs/repository-purpose.md +421 -0
- package/docs/research/ai-work-field-instrumentation-bridge.md +126 -0
- package/docs/research/baseline-comparison-protocol.md +79 -0
- package/docs/research/evidence-package-v0.1.md +99 -0
- package/docs/research/evidence-package-v0.2.md +150 -0
- package/docs/research/evidence-package-v0.3.md +226 -0
- package/docs/research/independent-implementation-pilot-plan.md +74 -0
- package/docs/research/limitations-and-threats.md +40 -0
- package/docs/research/practice-science-program.md +232 -0
- package/docs/research/scientific-evidence-package.md +154 -0
- package/docs/research/semantic-completeness-review-protocol.md +70 -0
- package/docs/terminology.md +119 -0
- package/docs/transfer/ai-employee-profile-proposal.md +119 -0
- package/docs/transfer/federation-routing-control-loop-2026-05-31.md +28 -0
- package/docs/transfer/graph-capability-map-2026-05-29.md +126 -0
- package/docs/transfer/graph-skill-to-mirai-graph.md +128 -0
- package/docs/transfer/project-management-standard-harvest-2026-06-02.md +322 -0
- package/docs/transfer/skill-graph-standard-harvest-2026-05-31.md +113 -0
- package/docs/transfer/standard-gap-report-2026-05-28.md +208 -0
- package/examples/ai-employee-minimal/README.md +53 -0
- package/examples/ai-employee-minimal/gates/results.json +35 -0
- package/examples/ai-employee-minimal/graph/objects.json +187 -0
- package/examples/ai-employee-minimal/graph/relations.json +167 -0
- package/examples/ai-employee-minimal/mirai-graph-package.json +14 -0
- package/examples/ai-employee-minimal/results/profile-conformance-result.json +28 -0
- package/examples/character-layer-integration-minimal/README.md +25 -0
- package/examples/character-layer-integration-minimal/results/character-layer-integration.json +53 -0
- package/examples/character-layer-minimal/README.md +29 -0
- package/examples/character-layer-minimal/gates/results.json +57 -0
- package/examples/character-layer-minimal/graph/objects.json +165 -0
- package/examples/character-layer-minimal/graph/relations.json +178 -0
- package/examples/character-layer-minimal/mirai-graph-package.json +14 -0
- package/examples/character-layer-readiness-1-0/README.md +27 -0
- package/examples/character-layer-readiness-1-0/results/character-layer-readiness.json +90 -0
- package/examples/federation-routing-smoke/README.md +19 -0
- package/examples/federation-routing-smoke/federation-health-dashboard.json +42 -0
- package/examples/federation-routing-smoke/route-explanation.json +32 -0
- package/examples/federation-routing-smoke/route-regression-result.json +35 -0
- package/examples/federation-routing-smoke/routes/production-deploy-execution-evidence.json +17 -0
- package/examples/federation-routing-smoke/routes/production-deploy-route-result.json +12 -0
- package/examples/federation-routing-smoke/routes/production-deploy-runtime-preflight.json +8 -0
- package/examples/federation-routing-smoke/routes/production-deploy-stderr.txt +1 -0
- package/examples/federation-routing-smoke/routes/production-deploy-stdout.txt +1 -0
- package/examples/federation-routing-smoke/routes/search-page-execution-evidence.json +17 -0
- package/examples/federation-routing-smoke/routes/search-page-route-result.json +12 -0
- package/examples/federation-routing-smoke/routes/search-page-stderr.txt +1 -0
- package/examples/federation-routing-smoke/routes/search-page-stdout.txt +1 -0
- package/examples/federation-routing-smoke/routing-fixture-run.json +66 -0
- package/examples/federation-routing-smoke/routing-fixtures.json +44 -0
- package/examples/graph-dna-alignment-minimal/README.md +16 -0
- package/examples/graph-dna-alignment-minimal/graph/objects.json +38 -0
- package/examples/graph-dna-alignment-minimal/graph/relations.json +20 -0
- package/examples/graph-dna-alignment-minimal/mirai-graph-package.json +14 -0
- package/examples/graph-dna-alignment-minimal/results/graph-dna-alignment.json +32 -0
- package/examples/graph-seed-minimal/README.md +9 -0
- package/examples/graph-seed-minimal/graph-embryo.json +63 -0
- package/examples/graph-seed-minimal/graph-seed.json +60 -0
- package/examples/implementation-control-cycles/README.md +47 -0
- package/examples/implementation-control-cycles/gates/results.json +22 -0
- package/examples/implementation-control-cycles/graph/objects.json +119 -0
- package/examples/implementation-control-cycles/graph/relations.json +200 -0
- package/examples/implementation-control-cycles/mirai-graph-package.json +14 -0
- package/examples/implementation-control-cycles/results/implementation-control-cycles.json +456 -0
- package/examples/implementation-control-minimal/README.md +39 -0
- package/examples/implementation-control-minimal/gates/results.json +42 -0
- package/examples/implementation-control-minimal/graph/objects.json +128 -0
- package/examples/implementation-control-minimal/graph/relations.json +128 -0
- package/examples/implementation-control-minimal/mirai-graph-package.json +14 -0
- package/examples/implementation-control-minimal/results/implementation-control-loop.json +21 -0
- package/examples/instrumentation-layer-minimal/README.md +32 -0
- package/examples/instrumentation-layer-minimal/gates/results.json +11 -0
- package/examples/instrumentation-layer-minimal/graph/objects.json +74 -0
- package/examples/instrumentation-layer-minimal/graph/relations.json +56 -0
- package/examples/instrumentation-layer-minimal/invalid-cockpit-missing-gates.json +40 -0
- package/examples/instrumentation-layer-minimal/invalid-feedback-accepted-with-blocking.json +38 -0
- package/examples/instrumentation-layer-minimal/invalid-feedback-process-improvement-without-kaizen.json +38 -0
- package/examples/instrumentation-layer-minimal/invalid-traceability-missing-evidence.json +43 -0
- package/examples/instrumentation-layer-minimal/mirai-graph-package.json +14 -0
- package/examples/instrumentation-layer-minimal/results/development-cockpit.json +68 -0
- package/examples/instrumentation-layer-minimal/results/feature-implementation-traceability.json +56 -0
- package/examples/instrumentation-layer-minimal/results/multi-source-quality-feedback.json +72 -0
- package/examples/invalid-character-layer-context-authorization/graph/objects.json +22 -0
- package/examples/invalid-character-layer-context-authorization/graph/relations.json +1 -0
- package/examples/invalid-character-layer-context-authorization/mirai-graph-package.json +14 -0
- package/examples/invalid-character-layer-correction-loop-no-review/graph/objects.json +22 -0
- package/examples/invalid-character-layer-correction-loop-no-review/graph/relations.json +1 -0
- package/examples/invalid-character-layer-correction-loop-no-review/mirai-graph-package.json +14 -0
- package/examples/invalid-character-layer-feedback-auto-update/graph/objects.json +22 -0
- package/examples/invalid-character-layer-feedback-auto-update/graph/relations.json +1 -0
- package/examples/invalid-character-layer-feedback-auto-update/mirai-graph-package.json +14 -0
- package/examples/invalid-character-layer-object-kind/graph/objects.json +22 -0
- package/examples/invalid-character-layer-object-kind/graph/relations.json +1 -0
- package/examples/invalid-character-layer-object-kind/mirai-graph-package.json +14 -0
- package/examples/invalid-character-layer-relation-direction/graph/objects.json +33 -0
- package/examples/invalid-character-layer-relation-direction/graph/relations.json +13 -0
- package/examples/invalid-character-layer-relation-direction/mirai-graph-package.json +14 -0
- package/examples/invalid-character-layer-relation-type/graph/objects.json +33 -0
- package/examples/invalid-character-layer-relation-type/graph/relations.json +13 -0
- package/examples/invalid-character-layer-relation-type/mirai-graph-package.json +14 -0
- package/examples/invalid-character-layer-role-permission/graph/objects.json +22 -0
- package/examples/invalid-character-layer-role-permission/graph/relations.json +1 -0
- package/examples/invalid-character-layer-role-permission/mirai-graph-package.json +14 -0
- package/examples/invalid-context-pack-missing-explanation/context-pack.json +25 -0
- package/examples/invalid-missing-relation-target/graph/objects.json +11 -0
- package/examples/invalid-missing-relation-target/graph/relations.json +11 -0
- package/examples/invalid-missing-relation-target/mirai-graph-package.json +11 -0
- package/examples/invalid-profile-object-kind/graph/objects.json +20 -0
- package/examples/invalid-profile-object-kind/graph/relations.json +1 -0
- package/examples/invalid-profile-object-kind/mirai-graph-package.json +11 -0
- package/examples/invalid-profile-relation-type/graph/objects.json +29 -0
- package/examples/invalid-profile-relation-type/graph/relations.json +11 -0
- package/examples/invalid-profile-relation-type/mirai-graph-package.json +11 -0
- package/examples/invalid-relation-id-mismatch/graph/objects.json +29 -0
- package/examples/invalid-relation-id-mismatch/graph/relations.json +11 -0
- package/examples/invalid-relation-id-mismatch/mirai-graph-package.json +11 -0
- package/examples/invalid-seed-unsafe-write/graph-seed.json +27 -0
- package/examples/launch-record-minimal/README.md +29 -0
- package/examples/launch-record-minimal/gates/results.json +12 -0
- package/examples/launch-record-minimal/graph/objects.json +47 -0
- package/examples/launch-record-minimal/graph/relations.json +38 -0
- package/examples/launch-record-minimal/mirai-graph-package.json +11 -0
- package/examples/launch-record-minimal/results/launch-record.json +51 -0
- package/examples/managed-project-control-loop/README.md +43 -0
- package/examples/managed-project-control-loop/gates/results.json +22 -0
- package/examples/managed-project-control-loop/graph/objects.json +119 -0
- package/examples/managed-project-control-loop/graph/relations.json +110 -0
- package/examples/managed-project-control-loop/mirai-graph-package.json +14 -0
- package/examples/managed-project-control-loop/results/managed-loop-result.json +21 -0
- package/examples/minimal-graph/README.md +15 -0
- package/examples/minimal-graph/gates/results.json +12 -0
- package/examples/minimal-graph/graph/objects.json +24 -0
- package/examples/minimal-graph/graph/relations.json +11 -0
- package/examples/minimal-graph/mirai-graph-package.json +14 -0
- package/examples/minimal-graph/results/profile-conformance-result.json +26 -0
- package/examples/model-portability-minimal/README.md +15 -0
- package/examples/model-portability-minimal/results/model-portability-evidence.json +55 -0
- package/examples/organization-governance-minimal/README.md +29 -0
- package/examples/organization-governance-minimal/gates/results.json +21 -0
- package/examples/organization-governance-minimal/graph/objects.json +147 -0
- package/examples/organization-governance-minimal/graph/relations.json +147 -0
- package/examples/organization-governance-minimal/mirai-graph-package.json +15 -0
- package/examples/organization-governance-minimal/results/profile-conformance-result.json +31 -0
- package/examples/process-control-contract-minimal/README.md +19 -0
- package/examples/process-control-contract-minimal/graph/objects.json +38 -0
- package/examples/process-control-contract-minimal/graph/relations.json +29 -0
- package/examples/process-control-contract-minimal/mirai-graph-package.json +11 -0
- package/examples/process-control-contract-minimal/results/process-control-contract.json +58 -0
- package/examples/process-transition-minimal/README.md +25 -0
- package/examples/process-transition-minimal/invalid-missing-launch-record.json +14 -0
- package/examples/process-transition-minimal/invalid-ready-to-written.json +14 -0
- package/examples/process-transition-minimal/invalid-release-missing-evidence.json +14 -0
- package/examples/process-transition-minimal/invalid-sync-to-update.json +14 -0
- package/examples/process-transition-minimal/invalid-terminal-missing-kaizen.json +14 -0
- package/examples/process-transition-minimal/invalid-tests-to-approved.json +14 -0
- package/examples/process-transition-minimal/results/transition-explanation-invalid-ready-to-written.json +35 -0
- package/examples/process-transition-minimal/results/transition-explanation-valid.json +34 -0
- package/examples/process-transition-minimal/state-machine.json +79 -0
- package/examples/process-transition-minimal/transition-request-skip-kaizen.json +14 -0
- package/examples/process-transition-minimal/transition-request.json +14 -0
- package/examples/risk-and-coordination-minimal/README.md +16 -0
- package/examples/risk-and-coordination-minimal/graph/objects.json +47 -0
- package/examples/risk-and-coordination-minimal/graph/relations.json +29 -0
- package/examples/risk-and-coordination-minimal/mirai-graph-package.json +14 -0
- package/examples/risk-and-coordination-minimal/results/multi-agent-coordination.json +25 -0
- package/examples/risk-and-coordination-minimal/results/risk-control-matrix.json +34 -0
- package/examples/skill-runtime-minimal/README.md +29 -0
- package/examples/skill-runtime-minimal/gates/results.json +35 -0
- package/examples/skill-runtime-minimal/graph/objects.json +209 -0
- package/examples/skill-runtime-minimal/graph/relations.json +178 -0
- package/examples/skill-runtime-minimal/mirai-graph-package.json +14 -0
- package/examples/skill-runtime-minimal/results/profile-conformance-result.json +27 -0
- package/examples/source-boundary-minimal/README.md +16 -0
- package/examples/source-boundary-minimal/graph/objects.json +38 -0
- package/examples/source-boundary-minimal/graph/relations.json +20 -0
- package/examples/source-boundary-minimal/mirai-graph-package.json +14 -0
- package/examples/source-boundary-minimal/results/source-boundary-contract.json +37 -0
- package/examples/technology-quality-feedback-minimal/README.md +33 -0
- package/examples/technology-quality-feedback-minimal/graph/objects.json +56 -0
- package/examples/technology-quality-feedback-minimal/graph/relations.json +47 -0
- package/examples/technology-quality-feedback-minimal/invalid-accepted-with-blocking.json +33 -0
- package/examples/technology-quality-feedback-minimal/invalid-evidence-as-authorization.json +22 -0
- package/examples/technology-quality-feedback-minimal/invalid-missing-required-step.json +22 -0
- package/examples/technology-quality-feedback-minimal/invalid-process-improvement-without-kaizen.json +33 -0
- package/examples/technology-quality-feedback-minimal/invalid-spec-gap-without-route.json +33 -0
- package/examples/technology-quality-feedback-minimal/invalid-unclassified-finding.json +33 -0
- package/examples/technology-quality-feedback-minimal/mirai-graph-package.json +11 -0
- package/examples/technology-quality-feedback-minimal/results/technology-quality-feedback.json +80 -0
- package/examples/work-recovery-minimal/README.md +15 -0
- package/examples/work-recovery-minimal/graph/objects.json +47 -0
- package/examples/work-recovery-minimal/graph/relations.json +20 -0
- package/examples/work-recovery-minimal/mirai-graph-package.json +14 -0
- package/examples/work-recovery-minimal/results/recovery-resume-record.json +17 -0
- package/examples/work-recovery-minimal/results/work-state-machine.json +21 -0
- package/package.json +104 -0
- package/packages/cli/adopter-workflow.js +227 -0
- package/packages/cli/context-pack.js +267 -0
- package/packages/cli/instrumentation-report.js +97 -0
- package/packages/cli/mirai-graph.js +121 -0
- package/packages/cli/mirai_graph.js +3 -0
- package/packages/cli/playground-demo.js +114 -0
- package/packages/cli/readiness-score.js +162 -0
- package/packages/cli/release-state.js +329 -0
- package/packages/cli/seed-preview.js +78 -0
- package/packages/cli/validate-adopter-workflow.js +63 -0
- package/packages/cli/validate-baseline-comparison.js +105 -0
- package/packages/cli/validate-mirai-graph.js +2434 -0
- package/packages/cli/validate-process-transition-report.js +105 -0
- package/packages/cli/validate-profile-results.js +64 -0
- package/packages/cli/validate-release-state.js +100 -0
- package/packages/cli/validate-routing-control-examples.js +79 -0
- package/pilots/independent-implementation-001-conference-planning/README.md +40 -0
- package/pilots/independent-implementation-001-conference-planning/gates/results.json +12 -0
- package/pilots/independent-implementation-001-conference-planning/graph/objects.json +74 -0
- package/pilots/independent-implementation-001-conference-planning/graph/relations.json +56 -0
- package/pilots/independent-implementation-001-conference-planning/graph-seed.json +65 -0
- package/pilots/independent-implementation-001-conference-planning/mirai-graph-package.json +14 -0
- package/pilots/independent-implementation-001-conference-planning/reports/pilot-report.md +120 -0
- package/pilots/independent-implementation-001-conference-planning/results/context-pack.json +35 -0
- package/pilots/independent-implementation-001-conference-planning/results/graph-embryo.json +81 -0
- package/pilots/independent-implementation-001-conference-planning/results/package-validation.json +7 -0
- package/pilots/independent-implementation-001-conference-planning/results/profile-conformance-result.json +28 -0
- package/pilots/independent-implementation-001-conference-planning/results/readiness-score.json +26 -0
- package/pilots/independent-implementation-001-conference-planning/results/seed-validation.json +7 -0
- package/pilots/independent-implementation-002-software-specification/README.md +40 -0
- package/pilots/independent-implementation-002-software-specification/gates/results.json +22 -0
- package/pilots/independent-implementation-002-software-specification/graph/objects.json +101 -0
- package/pilots/independent-implementation-002-software-specification/graph/relations.json +92 -0
- package/pilots/independent-implementation-002-software-specification/graph-seed.json +72 -0
- package/pilots/independent-implementation-002-software-specification/mirai-graph-package.json +14 -0
- package/pilots/independent-implementation-002-software-specification/reports/pilot-report.md +142 -0
- package/pilots/independent-implementation-002-software-specification/results/context-pack.json +184 -0
- package/pilots/independent-implementation-002-software-specification/results/graph-embryo.json +90 -0
- package/pilots/independent-implementation-002-software-specification/results/package-validation.json +7 -0
- package/pilots/independent-implementation-002-software-specification/results/profile-conformance-result.json +28 -0
- package/pilots/independent-implementation-002-software-specification/results/readiness-score.json +26 -0
- package/pilots/independent-implementation-002-software-specification/results/seed-validation.json +7 -0
- package/pilots/independent-implementation-002-software-specification/reviews/semantic-completeness-review.json +81 -0
- package/pilots/independent-implementation-003-ai-employee-workflow/README.md +42 -0
- package/pilots/independent-implementation-003-ai-employee-workflow/gates/results.json +30 -0
- package/pilots/independent-implementation-003-ai-employee-workflow/graph/objects.json +156 -0
- package/pilots/independent-implementation-003-ai-employee-workflow/graph/relations.json +147 -0
- package/pilots/independent-implementation-003-ai-employee-workflow/graph-seed.json +90 -0
- package/pilots/independent-implementation-003-ai-employee-workflow/mirai-graph-package.json +15 -0
- package/pilots/independent-implementation-003-ai-employee-workflow/reports/pilot-report.md +49 -0
- package/pilots/independent-implementation-003-ai-employee-workflow/results/profile-conformance-result.json +30 -0
- package/pilots/independent-implementation-004-research-program/README.md +41 -0
- package/pilots/independent-implementation-004-research-program/gates/results.json +21 -0
- package/pilots/independent-implementation-004-research-program/graph/objects.json +102 -0
- package/pilots/independent-implementation-004-research-program/graph/relations.json +84 -0
- package/pilots/independent-implementation-004-research-program/graph-seed.json +76 -0
- package/pilots/independent-implementation-004-research-program/mirai-graph-package.json +15 -0
- package/pilots/independent-implementation-004-research-program/reports/pilot-report.md +50 -0
- package/pilots/independent-implementation-004-research-program/results/profile-conformance-result.json +30 -0
- package/pilots/independent-implementation-005-organization-governance/README.md +42 -0
- package/pilots/independent-implementation-005-organization-governance/gates/results.json +20 -0
- package/pilots/independent-implementation-005-organization-governance/graph/objects.json +137 -0
- package/pilots/independent-implementation-005-organization-governance/graph/relations.json +110 -0
- package/pilots/independent-implementation-005-organization-governance/graph-seed.json +97 -0
- package/pilots/independent-implementation-005-organization-governance/mirai-graph-package.json +14 -0
- package/pilots/independent-implementation-005-organization-governance/reports/pilot-report.md +47 -0
- package/pilots/independent-implementation-005-organization-governance/results/profile-conformance-result.json +29 -0
- package/playground/README.md +78 -0
- package/playground/demo-report.md +84 -0
- package/profiles/README.md +19 -0
- package/profiles/ai-employee/README.md +132 -0
- package/profiles/ai-employee/profile.json +58 -0
- package/profiles/character-layer/README.md +143 -0
- package/profiles/character-layer/profile.json +46 -0
- package/profiles/implementation-control/README.md +170 -0
- package/profiles/implementation-control/profile.json +106 -0
- package/profiles/organization-governance/README.md +61 -0
- package/profiles/organization-governance/profile.json +56 -0
- package/profiles/project-management/README.md +115 -0
- package/profiles/project-management/profile.json +31 -0
- package/profiles/skill-runtime/README.md +94 -0
- package/profiles/skill-runtime/profile.json +58 -0
- package/profiles/software-specification/README.md +142 -0
- package/profiles/software-specification/profile.json +31 -0
- package/publications/README.md +24 -0
- package/publications/preprint-note.md +11 -0
- package/publications/preprint-outline.md +45 -0
- package/releases/0.1.0-alpha.0.md +45 -0
- package/releases/0.1.0-alpha.1.md +63 -0
- package/releases/0.1.0-alpha.10.md +93 -0
- package/releases/0.1.0-alpha.11.md +114 -0
- package/releases/0.1.0-alpha.2.md +37 -0
- package/releases/0.1.0-alpha.3.md +61 -0
- package/releases/0.1.0-alpha.4.md +53 -0
- package/releases/0.1.0-alpha.5.md +48 -0
- package/releases/0.1.0-alpha.6.md +96 -0
- package/releases/0.1.0-alpha.7.md +114 -0
- package/releases/0.1.0-alpha.8.md +92 -0
- package/releases/0.1.0-alpha.9.md +80 -0
- package/releases/1.0.0-rc.1.md +112 -0
- package/releases/README.md +114 -0
- package/schemas/baseline-comparison-result.schema.json +87 -0
- package/schemas/character-layer-integration.schema.json +112 -0
- package/schemas/character-layer-readiness.schema.json +73 -0
- package/schemas/context-pack.schema.json +137 -0
- package/schemas/development-cockpit.schema.json +74 -0
- package/schemas/feature-implementation-traceability.schema.json +80 -0
- package/schemas/federation-health-dashboard.schema.json +47 -0
- package/schemas/gate-result.schema.json +44 -0
- package/schemas/graph-dna-alignment.schema.json +49 -0
- package/schemas/graph-embryo.schema.json +51 -0
- package/schemas/graph-seed.schema.json +137 -0
- package/schemas/implementation-control-cycle.schema.json +265 -0
- package/schemas/implementation-control-loop.schema.json +84 -0
- package/schemas/launch-record.schema.json +78 -0
- package/schemas/model-portability-evidence.schema.json +93 -0
- package/schemas/multi-agent-coordination.schema.json +35 -0
- package/schemas/multi-source-quality-feedback.schema.json +54 -0
- package/schemas/object.schema.json +49 -0
- package/schemas/package-manifest.schema.json +53 -0
- package/schemas/process-control-contract.schema.json +100 -0
- package/schemas/process-transition-request.schema.json +41 -0
- package/schemas/profile.schema.json +56 -0
- package/schemas/readiness-score.schema.json +43 -0
- package/schemas/recovery-resume-record.schema.json +25 -0
- package/schemas/relation.schema.json +43 -0
- package/schemas/risk-control-matrix.schema.json +36 -0
- package/schemas/route-explanation.schema.json +51 -0
- package/schemas/route-regression-result.schema.json +33 -0
- package/schemas/routing-fixture-run.schema.json +45 -0
- package/schemas/routing-fixtures.schema.json +59 -0
- package/schemas/source-boundary-contract.schema.json +31 -0
- package/schemas/technology-quality-feedback.schema.json +116 -0
- package/schemas/work-state-machine.schema.json +34 -0
- package/standard/action-runtime-boundary.md +99 -0
- package/standard/adoption-levels.md +69 -0
- package/standard/conformance-levels.md +133 -0
- package/standard/context-pack-generation.md +141 -0
- package/standard/development-cockpit.md +67 -0
- package/standard/evidence-provenance.md +128 -0
- package/standard/feature-implementation-traceability.md +68 -0
- package/standard/federation-health.md +42 -0
- package/standard/feedback-learning-gate.md +101 -0
- package/standard/governance.md +137 -0
- package/standard/graph-as-ai-brain.md +81 -0
- package/standard/graph-dna-alignment.md +50 -0
- package/standard/graph-dna.md +70 -0
- package/standard/graph-embryo.md +69 -0
- package/standard/graph-seed.md +122 -0
- package/standard/hybrid-source-of-truth.md +91 -0
- package/standard/implementation-control-cycles.md +194 -0
- package/standard/implementation-control.md +102 -0
- package/standard/launch-record.md +53 -0
- package/standard/lifecycle-readiness.md +159 -0
- package/standard/multi-agent-coordination.md +50 -0
- package/standard/multi-source-quality-feedback.md +71 -0
- package/standard/object-model.md +152 -0
- package/standard/organization-governance.md +84 -0
- package/standard/process-control-contract.md +53 -0
- package/standard/profiles.md +233 -0
- package/standard/projection-views.md +69 -0
- package/standard/recovery-resume.md +49 -0
- package/standard/relation-model.md +139 -0
- package/standard/risk-control-matrix.md +53 -0
- package/standard/route-explanation.md +35 -0
- package/standard/route-regression.md +33 -0
- package/standard/routing-fixtures.md +54 -0
- package/standard/runtime-enablement.md +85 -0
- package/standard/source-boundary-contract.md +49 -0
- package/standard/standard-v0.1.md +132 -0
- package/standard/technology-quality-feedback.md +97 -0
- package/standard/test-suite.md +105 -0
- package/standard/work-state-machine.md +62 -0
- package/templates/README.md +64 -0
- package/templates/ai-employee-starter/README.md +9 -0
- package/templates/ai-employee-starter/gates/results.json +12 -0
- package/templates/ai-employee-starter/graph/objects.json +90 -0
- package/templates/ai-employee-starter/graph/relations.json +47 -0
- package/templates/ai-employee-starter/mirai-graph-package.json +14 -0
- package/templates/character-layer-starter/README.md +39 -0
- package/templates/character-layer-starter/gates/results.json +20 -0
- package/templates/character-layer-starter/graph/objects.json +308 -0
- package/templates/character-layer-starter/graph/relations.json +344 -0
- package/templates/character-layer-starter/mirai-graph-package.json +14 -0
- package/templates/organization-governance-starter/README.md +9 -0
- package/templates/organization-governance-starter/gates/results.json +12 -0
- package/templates/organization-governance-starter/graph/objects.json +112 -0
- package/templates/organization-governance-starter/graph/relations.json +65 -0
- package/templates/organization-governance-starter/mirai-graph-package.json +14 -0
- package/templates/research-program-starter/README.md +9 -0
- package/templates/research-program-starter/gates/results.json +12 -0
- package/templates/research-program-starter/graph/objects.json +79 -0
- package/templates/research-program-starter/graph/relations.json +47 -0
- package/templates/research-program-starter/mirai-graph-package.json +14 -0
- package/templates/software-project-starter/README.md +9 -0
- package/templates/software-project-starter/gates/results.json +12 -0
- package/templates/software-project-starter/graph/objects.json +79 -0
- package/templates/software-project-starter/graph/relations.json +47 -0
- package/templates/software-project-starter/mirai-graph-package.json +14 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const https = require("https");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const { spawnSync } = require("child_process");
|
|
7
|
+
|
|
8
|
+
const root = path.resolve(__dirname, "..", "..");
|
|
9
|
+
|
|
10
|
+
function run(command, args) {
|
|
11
|
+
const result = spawnSync(command, args, {
|
|
12
|
+
cwd: root,
|
|
13
|
+
encoding: "utf8"
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
status: result.status === null ? 1 : result.status,
|
|
17
|
+
stdout: (result.stdout || "").trim(),
|
|
18
|
+
stderr: (result.stderr || "").trim()
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getJson(url) {
|
|
23
|
+
return new Promise((resolve) => {
|
|
24
|
+
const request = https.get(url, {
|
|
25
|
+
headers: {
|
|
26
|
+
"Accept": "application/json",
|
|
27
|
+
"User-Agent": "mirai-graph-release-state"
|
|
28
|
+
}
|
|
29
|
+
}, (response) => {
|
|
30
|
+
let body = "";
|
|
31
|
+
response.setEncoding("utf8");
|
|
32
|
+
response.on("data", (chunk) => {
|
|
33
|
+
body += chunk;
|
|
34
|
+
});
|
|
35
|
+
response.on("end", () => {
|
|
36
|
+
if (response.statusCode === 404) {
|
|
37
|
+
resolve({ status_code: 404, found: false, body: null });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if ((response.statusCode || 0) >= 400) {
|
|
41
|
+
resolve({
|
|
42
|
+
status_code: response.statusCode,
|
|
43
|
+
found: false,
|
|
44
|
+
error: `http_${response.statusCode}`
|
|
45
|
+
});
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
resolve({
|
|
50
|
+
status_code: response.statusCode,
|
|
51
|
+
found: true,
|
|
52
|
+
body: JSON.parse(body)
|
|
53
|
+
});
|
|
54
|
+
} catch (error) {
|
|
55
|
+
resolve({
|
|
56
|
+
status_code: response.statusCode,
|
|
57
|
+
found: false,
|
|
58
|
+
error: "invalid_json"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
request.on("error", (error) => {
|
|
64
|
+
resolve({ status_code: null, found: false, error: error.code || error.message });
|
|
65
|
+
});
|
|
66
|
+
request.setTimeout(15000, () => {
|
|
67
|
+
request.destroy();
|
|
68
|
+
resolve({ status_code: null, found: false, error: "timeout" });
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function loadPackage() {
|
|
74
|
+
const packagePath = path.join(root, "package.json");
|
|
75
|
+
const packageJson = JSON.parse(fs.readFileSync(packagePath, "utf8"));
|
|
76
|
+
return {
|
|
77
|
+
name: packageJson.name,
|
|
78
|
+
version: packageJson.version,
|
|
79
|
+
repository: packageJson.repository && packageJson.repository.url,
|
|
80
|
+
path: "package.json"
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function parseGitHubRepo(repositoryUrl) {
|
|
85
|
+
if (!repositoryUrl) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
const match = repositoryUrl.match(/github\.com[:/](.+?)\/(.+?)(?:\.git)?$/);
|
|
89
|
+
if (!match) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
owner: match[1],
|
|
94
|
+
repo: match[2].replace(/\.git$/, "")
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function buildState(options = {}) {
|
|
99
|
+
const pkg = loadPackage();
|
|
100
|
+
const tag = `v${pkg.version}`;
|
|
101
|
+
const requireGitTag = Boolean(options.requireGitTag || options.requireGithubRelease || options.requireNpmPublished);
|
|
102
|
+
const requireGithubRelease = Boolean(options.requireGithubRelease || options.requireNpmPublished);
|
|
103
|
+
const blockers = [];
|
|
104
|
+
const warnings = [];
|
|
105
|
+
|
|
106
|
+
const head = run("git", ["rev-parse", "HEAD"]);
|
|
107
|
+
const tagCommit = run("git", ["rev-parse", `${tag}^{}`]);
|
|
108
|
+
const status = run("git", ["status", "--short", "--branch", "--untracked-files=all"]);
|
|
109
|
+
|
|
110
|
+
const npmAuth = run("npm", ["whoami"]);
|
|
111
|
+
const npmRegistry = await getJson(`https://registry.npmjs.org/${encodeURIComponent(pkg.name)}`);
|
|
112
|
+
const npmPackage = {
|
|
113
|
+
registry_url: `https://registry.npmjs.org/${pkg.name}`,
|
|
114
|
+
found: npmRegistry.found,
|
|
115
|
+
status_code: npmRegistry.status_code,
|
|
116
|
+
latest: null,
|
|
117
|
+
version_published: false,
|
|
118
|
+
error: npmRegistry.error || null
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
if (npmRegistry.found && npmRegistry.body) {
|
|
122
|
+
npmPackage.latest = npmRegistry.body["dist-tags"] && npmRegistry.body["dist-tags"].latest || null;
|
|
123
|
+
npmPackage.version_published = Boolean(npmRegistry.body.versions && npmRegistry.body.versions[pkg.version]);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const npm = {
|
|
127
|
+
authenticated: npmAuth.status === 0,
|
|
128
|
+
whoami: npmAuth.status === 0 ? npmAuth.stdout : null,
|
|
129
|
+
auth_error: npmAuth.status === 0 ? null : classifyNpmAuthError(npmAuth.stderr || npmAuth.stdout),
|
|
130
|
+
package: npmPackage
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
if (!npm.authenticated) {
|
|
134
|
+
blockers.push({
|
|
135
|
+
id: "npm_auth_missing",
|
|
136
|
+
severity: "publish_blocker",
|
|
137
|
+
message: "npm publish requires npm login or an owner-approved npm token."
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (!npmPackage.version_published) {
|
|
141
|
+
blockers.push({
|
|
142
|
+
id: "npm_package_version_not_published",
|
|
143
|
+
severity: options.requireNpmPublished ? "release_blocker" : "publication_pending",
|
|
144
|
+
message: `${pkg.name}@${pkg.version} is not published on npm.`
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const githubRepo = parseGitHubRepo(pkg.repository);
|
|
149
|
+
let githubRelease = {
|
|
150
|
+
repository: githubRepo,
|
|
151
|
+
tag,
|
|
152
|
+
found: false,
|
|
153
|
+
url: null,
|
|
154
|
+
draft: null,
|
|
155
|
+
prerelease: null,
|
|
156
|
+
error: githubRepo ? null : "repository_not_github"
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
if (githubRepo) {
|
|
160
|
+
const release = await getJson(`https://api.github.com/repos/${githubRepo.owner}/${githubRepo.repo}/releases/tags/${tag}`);
|
|
161
|
+
githubRelease = {
|
|
162
|
+
repository: githubRepo,
|
|
163
|
+
tag,
|
|
164
|
+
found: release.found,
|
|
165
|
+
status_code: release.status_code,
|
|
166
|
+
url: release.body && release.body.html_url || null,
|
|
167
|
+
name: release.body && release.body.name || null,
|
|
168
|
+
draft: release.body ? Boolean(release.body.draft) : null,
|
|
169
|
+
prerelease: release.body ? Boolean(release.body.prerelease) : null,
|
|
170
|
+
error: release.error || null
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (head.status !== 0) {
|
|
175
|
+
blockers.push({ id: "git_head_unavailable", severity: "release_blocker", message: "Cannot resolve git HEAD." });
|
|
176
|
+
}
|
|
177
|
+
if (tagCommit.status !== 0) {
|
|
178
|
+
blockers.push({
|
|
179
|
+
id: "git_tag_missing",
|
|
180
|
+
severity: requireGitTag ? "release_blocker" : "release_pending",
|
|
181
|
+
message: `Local tag ${tag} is missing.`
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (!githubRelease.found) {
|
|
185
|
+
blockers.push({
|
|
186
|
+
id: "github_release_missing",
|
|
187
|
+
severity: requireGithubRelease ? "release_blocker" : "release_pending",
|
|
188
|
+
message: `GitHub Release ${tag} is missing.`
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
if (status.stdout.includes("\n")) {
|
|
192
|
+
warnings.push({
|
|
193
|
+
id: "working_tree_has_changes",
|
|
194
|
+
message: "Working tree has local changes; release state is still reportable but should not be published until clean."
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const fatalBlockers = blockers.filter((blocker) => blocker.severity === "release_blocker");
|
|
199
|
+
const valid = fatalBlockers.length === 0;
|
|
200
|
+
|
|
201
|
+
return {
|
|
202
|
+
report_type: "mirai_graph_release_state",
|
|
203
|
+
valid,
|
|
204
|
+
generated_at: new Date().toISOString(),
|
|
205
|
+
package: pkg,
|
|
206
|
+
git: {
|
|
207
|
+
head: head.status === 0 ? head.stdout : null,
|
|
208
|
+
tag,
|
|
209
|
+
tag_commit: tagCommit.status === 0 ? tagCommit.stdout : null,
|
|
210
|
+
tag_exists: tagCommit.status === 0,
|
|
211
|
+
status: status.stdout
|
|
212
|
+
},
|
|
213
|
+
github_release: githubRelease,
|
|
214
|
+
npm,
|
|
215
|
+
blockers,
|
|
216
|
+
warnings,
|
|
217
|
+
boundary: [
|
|
218
|
+
"This report does not publish npm packages, create tags or mutate GitHub releases.",
|
|
219
|
+
"Pre-tag release-state checks may report git tag and GitHub Release as release_pending.",
|
|
220
|
+
"Missing npm authentication is a publish blocker, not a reason to expose tokens.",
|
|
221
|
+
"A release-state report is evidence, not release authorization."
|
|
222
|
+
]
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function classifyNpmAuthError(output) {
|
|
227
|
+
if (output.includes("ENEEDAUTH")) {
|
|
228
|
+
return "ENEEDAUTH";
|
|
229
|
+
}
|
|
230
|
+
if (output.includes("E401")) {
|
|
231
|
+
return "E401";
|
|
232
|
+
}
|
|
233
|
+
if (output.includes("not logged in")) {
|
|
234
|
+
return "not_logged_in";
|
|
235
|
+
}
|
|
236
|
+
return "unknown";
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function renderMarkdown(state) {
|
|
240
|
+
const lines = [];
|
|
241
|
+
lines.push("# Mirai Graph Release State");
|
|
242
|
+
lines.push("");
|
|
243
|
+
lines.push(`Generated: ${state.generated_at}`);
|
|
244
|
+
lines.push(`Valid for release-state check: \`${state.valid}\``);
|
|
245
|
+
lines.push("");
|
|
246
|
+
lines.push("## Package");
|
|
247
|
+
lines.push("");
|
|
248
|
+
lines.push(`- Name: \`${state.package.name}\``);
|
|
249
|
+
lines.push(`- Version: \`${state.package.version}\``);
|
|
250
|
+
lines.push(`- Repository: \`${state.package.repository}\``);
|
|
251
|
+
lines.push("");
|
|
252
|
+
lines.push("## Git");
|
|
253
|
+
lines.push("");
|
|
254
|
+
lines.push(`- HEAD: \`${state.git.head || "unavailable"}\``);
|
|
255
|
+
lines.push(`- Tag: \`${state.git.tag}\``);
|
|
256
|
+
lines.push(`- Tag exists: \`${state.git.tag_exists}\``);
|
|
257
|
+
lines.push("");
|
|
258
|
+
lines.push("## GitHub Release");
|
|
259
|
+
lines.push("");
|
|
260
|
+
lines.push(`- Found: \`${state.github_release.found}\``);
|
|
261
|
+
lines.push(`- URL: ${state.github_release.url || "n/a"}`);
|
|
262
|
+
lines.push(`- Draft: \`${state.github_release.draft}\``);
|
|
263
|
+
lines.push(`- Prerelease: \`${state.github_release.prerelease}\``);
|
|
264
|
+
lines.push("");
|
|
265
|
+
lines.push("## NPM Package");
|
|
266
|
+
lines.push("");
|
|
267
|
+
lines.push(`- Registry found: \`${state.npm.package.found}\``);
|
|
268
|
+
lines.push(`- Version published: \`${state.npm.package.version_published}\``);
|
|
269
|
+
lines.push(`- Latest: \`${state.npm.package.latest || "n/a"}\``);
|
|
270
|
+
lines.push(`- Authenticated: \`${state.npm.authenticated}\``);
|
|
271
|
+
lines.push(`- Auth error: \`${state.npm.auth_error || "n/a"}\``);
|
|
272
|
+
lines.push("");
|
|
273
|
+
lines.push("## Blockers");
|
|
274
|
+
lines.push("");
|
|
275
|
+
if (state.blockers.length === 0) {
|
|
276
|
+
lines.push("- None.");
|
|
277
|
+
} else {
|
|
278
|
+
for (const blocker of state.blockers) {
|
|
279
|
+
lines.push(`- \`${blocker.id}\` (${blocker.severity}): ${blocker.message}`);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
lines.push("");
|
|
283
|
+
lines.push("## Warnings");
|
|
284
|
+
lines.push("");
|
|
285
|
+
if (state.warnings.length === 0) {
|
|
286
|
+
lines.push("- None.");
|
|
287
|
+
} else {
|
|
288
|
+
for (const warning of state.warnings) {
|
|
289
|
+
lines.push(`- \`${warning.id}\`: ${warning.message}`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
lines.push("");
|
|
293
|
+
lines.push("## Boundary");
|
|
294
|
+
lines.push("");
|
|
295
|
+
for (const item of state.boundary) {
|
|
296
|
+
lines.push(`- ${item}`);
|
|
297
|
+
}
|
|
298
|
+
lines.push("");
|
|
299
|
+
return lines.join("\n");
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
async function main() {
|
|
303
|
+
const args = process.argv.slice(2);
|
|
304
|
+
const markdown = args.includes("--markdown");
|
|
305
|
+
const requireNpmPublished = args.includes("--require-npm-published");
|
|
306
|
+
const requireGitTag = args.includes("--require-git-tag");
|
|
307
|
+
const requireGithubRelease = args.includes("--require-github-release");
|
|
308
|
+
const state = await buildState({ requireNpmPublished, requireGitTag, requireGithubRelease });
|
|
309
|
+
if (markdown) {
|
|
310
|
+
process.stdout.write(renderMarkdown(state));
|
|
311
|
+
} else {
|
|
312
|
+
process.stdout.write(`${JSON.stringify(state, null, 2)}\n`);
|
|
313
|
+
}
|
|
314
|
+
if (!state.valid || (requireNpmPublished && !state.npm.package.version_published)) {
|
|
315
|
+
process.exit(1);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (require.main === module) {
|
|
320
|
+
main().catch((error) => {
|
|
321
|
+
console.error(error.message);
|
|
322
|
+
process.exit(1);
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
module.exports = {
|
|
327
|
+
buildState,
|
|
328
|
+
renderMarkdown
|
|
329
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
function usage() {
|
|
7
|
+
console.error("Usage: node packages/cli/seed-preview.js <seed-file> [--write <output-file>]");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function readJson(filePath) {
|
|
11
|
+
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function titleFromFamily(family) {
|
|
15
|
+
return family
|
|
16
|
+
.split("_")
|
|
17
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
18
|
+
.join(" ");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function buildEmbryo(seed) {
|
|
22
|
+
const maxObjects = Math.max(1, Math.min(seed.growth_rules.max_initial_objects || 1, 8));
|
|
23
|
+
const families = (seed.growth_rules.allowed_object_families || []).slice(0, maxObjects);
|
|
24
|
+
const profile = seed.target_profile.replace(/^profile\./, "");
|
|
25
|
+
const candidateObjects = families.map((family, index) => ({
|
|
26
|
+
id: `${family}.candidate_${index + 1}`,
|
|
27
|
+
kind: family,
|
|
28
|
+
title: `Candidate ${titleFromFamily(family)}`,
|
|
29
|
+
summary: `Candidate ${family} object proposed from seed ${seed.seed_id}.`,
|
|
30
|
+
readiness: "draft",
|
|
31
|
+
evidence: [],
|
|
32
|
+
profile
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
schema_version: "0.1.0",
|
|
37
|
+
embryo_id: `embryo.${seed.seed_id.replace(/^seed\./, "")}`,
|
|
38
|
+
seed_id: seed.seed_id,
|
|
39
|
+
generated_at: new Date().toISOString(),
|
|
40
|
+
candidate_objects: candidateObjects,
|
|
41
|
+
candidate_relations: [],
|
|
42
|
+
uncertain_items: [
|
|
43
|
+
"This is a deterministic seed preview, not extracted canonical graph state."
|
|
44
|
+
],
|
|
45
|
+
review_questions: [
|
|
46
|
+
"Do the candidate object families match the graph purpose?",
|
|
47
|
+
"Are source boundaries sufficient for the first extraction pass?",
|
|
48
|
+
"Should canonical write remain blocked until human review?"
|
|
49
|
+
],
|
|
50
|
+
stop_conditions_triggered: []
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const seedPath = process.argv[2];
|
|
55
|
+
const writeFlagIndex = process.argv.indexOf("--write");
|
|
56
|
+
const outputPath = writeFlagIndex >= 0 ? process.argv[writeFlagIndex + 1] : null;
|
|
57
|
+
|
|
58
|
+
if (!seedPath || (writeFlagIndex >= 0 && !outputPath)) {
|
|
59
|
+
usage();
|
|
60
|
+
process.exit(2);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
const seed = readJson(path.resolve(seedPath));
|
|
65
|
+
const embryo = buildEmbryo(seed);
|
|
66
|
+
const output = JSON.stringify(embryo, null, 2);
|
|
67
|
+
|
|
68
|
+
if (outputPath) {
|
|
69
|
+
const resolvedOutputPath = path.resolve(outputPath);
|
|
70
|
+
fs.mkdirSync(path.dirname(resolvedOutputPath), { recursive: true });
|
|
71
|
+
fs.writeFileSync(resolvedOutputPath, `${output}\n`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log(output);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error(error.message);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const root = path.resolve(__dirname, "..", "..");
|
|
7
|
+
const node = process.execPath;
|
|
8
|
+
const cli = path.join(root, "packages", "cli", "mirai-graph.js");
|
|
9
|
+
|
|
10
|
+
const checks = [
|
|
11
|
+
{
|
|
12
|
+
name: "profile map",
|
|
13
|
+
args: ["choose-profile"],
|
|
14
|
+
includes: ["Mirai Graph Profile Selection", "software_specification", "organization_governance"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "developer plan",
|
|
18
|
+
args: ["adopter", "plan", "developer"],
|
|
19
|
+
includes: ["Mirai Graph Adopter Plan: developer", "software-project-starter", "launch/evidence/kaizen"]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "ai employee plan",
|
|
23
|
+
args: ["adopter", "plan", "ai_employee"],
|
|
24
|
+
includes: ["Mirai Graph Adopter Plan: ai-employee", "ai_employee", "ai-employee-starter"]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "organization report",
|
|
28
|
+
args: ["adopter", "report", "templates/organization-governance-starter"],
|
|
29
|
+
includes: ["Mirai Graph Adopter Report", "organization_governance", "Adoption Checklist"]
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const errors = [];
|
|
34
|
+
|
|
35
|
+
for (const check of checks) {
|
|
36
|
+
const result = spawnSync(node, [cli, ...check.args], {
|
|
37
|
+
cwd: root,
|
|
38
|
+
encoding: "utf8"
|
|
39
|
+
});
|
|
40
|
+
if (result.status !== 0) {
|
|
41
|
+
errors.push(`${check.name}: command failed with exit ${result.status}`);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const output = `${result.stdout}\n${result.stderr}`;
|
|
45
|
+
for (const expected of check.includes) {
|
|
46
|
+
if (!output.includes(expected)) {
|
|
47
|
+
errors.push(`${check.name}: missing expected text ${JSON.stringify(expected)}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const result = {
|
|
53
|
+
mode: "adopter_workflow",
|
|
54
|
+
valid: errors.length === 0,
|
|
55
|
+
checked_commands: checks.map((check) => `mirai-graph ${check.args.join(" ")}`),
|
|
56
|
+
errors
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
console.log(JSON.stringify(result, null, 2));
|
|
60
|
+
|
|
61
|
+
if (errors.length > 0) {
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
|
|
5
|
+
const resultPath = process.argv[2] || "benchmarks/synthetic-context-reduction-v0/results/baseline-comparison-result.json";
|
|
6
|
+
|
|
7
|
+
function readJson(filePath) {
|
|
8
|
+
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function requireString(value, label, errors) {
|
|
12
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
13
|
+
errors.push(`${label} must be a non-empty string`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function requireNumber(value, label, errors) {
|
|
18
|
+
if (typeof value !== "number" || Number.isNaN(value)) {
|
|
19
|
+
errors.push(`${label} must be a number`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const errors = [];
|
|
24
|
+
const result = readJson(resultPath);
|
|
25
|
+
|
|
26
|
+
requireString(result.schema_version, "schema_version", errors);
|
|
27
|
+
requireString(result.id, "id", errors);
|
|
28
|
+
requireString(result.task_id, "task_id", errors);
|
|
29
|
+
if (result.public_safety !== "synthetic_public") {
|
|
30
|
+
errors.push("public_safety must be synthetic_public");
|
|
31
|
+
}
|
|
32
|
+
if (result.comparison_type !== "baseline_vs_mirai_graph") {
|
|
33
|
+
errors.push("comparison_type must be baseline_vs_mirai_graph");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
for (const side of ["baseline", "mirai_graph"]) {
|
|
37
|
+
const metrics = result[side];
|
|
38
|
+
if (!metrics || typeof metrics !== "object" || Array.isArray(metrics)) {
|
|
39
|
+
errors.push(`${side} must be an object`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
for (const field of [
|
|
43
|
+
"context_units",
|
|
44
|
+
"missed_dependencies",
|
|
45
|
+
"unsupported_assumptions",
|
|
46
|
+
"evidence_coverage_percent",
|
|
47
|
+
"false_progress_claims"
|
|
48
|
+
]) {
|
|
49
|
+
requireNumber(metrics[field], `${side}.${field}`, errors);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!result.outcome || typeof result.outcome !== "object" || Array.isArray(result.outcome)) {
|
|
54
|
+
errors.push("outcome must be an object");
|
|
55
|
+
} else {
|
|
56
|
+
requireNumber(result.outcome.context_reduction_percent, "outcome.context_reduction_percent", errors);
|
|
57
|
+
if (!Array.isArray(result.outcome.improved_metrics) || result.outcome.improved_metrics.length === 0) {
|
|
58
|
+
errors.push("outcome.improved_metrics must be a non-empty array");
|
|
59
|
+
}
|
|
60
|
+
if (!Array.isArray(result.outcome.regressed_metrics)) {
|
|
61
|
+
errors.push("outcome.regressed_metrics must be an array");
|
|
62
|
+
}
|
|
63
|
+
requireString(result.outcome.verdict, "outcome.verdict", errors);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (
|
|
67
|
+
result.baseline &&
|
|
68
|
+
result.mirai_graph &&
|
|
69
|
+
typeof result.baseline.context_units === "number" &&
|
|
70
|
+
typeof result.mirai_graph.context_units === "number" &&
|
|
71
|
+
result.mirai_graph.context_units > result.baseline.context_units
|
|
72
|
+
) {
|
|
73
|
+
errors.push("mirai_graph.context_units must not exceed baseline.context_units for this fixture");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (
|
|
77
|
+
result.baseline &&
|
|
78
|
+
result.mirai_graph &&
|
|
79
|
+
typeof result.mirai_graph.evidence_coverage_percent === "number" &&
|
|
80
|
+
typeof result.baseline.evidence_coverage_percent === "number" &&
|
|
81
|
+
result.mirai_graph.evidence_coverage_percent < result.baseline.evidence_coverage_percent
|
|
82
|
+
) {
|
|
83
|
+
errors.push("mirai_graph.evidence_coverage_percent must not be lower than baseline for this fixture");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (!Array.isArray(result.limitations) || result.limitations.length === 0) {
|
|
87
|
+
errors.push("limitations must be a non-empty array");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (
|
|
91
|
+
typeof result.claim_boundary !== "string" ||
|
|
92
|
+
!result.claim_boundary.toLowerCase().includes("synthetic")
|
|
93
|
+
) {
|
|
94
|
+
errors.push("claim_boundary must explicitly keep the claim synthetic");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const output = {
|
|
98
|
+
mode: "baseline_comparison_result",
|
|
99
|
+
target: resultPath,
|
|
100
|
+
valid: errors.length === 0,
|
|
101
|
+
errors
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
console.log(JSON.stringify(output, null, 2));
|
|
105
|
+
process.exit(output.valid ? 0 : 1);
|