mirai-graph 1.3.0 → 2.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/cli.js +6 -0
- package/index.js +1 -0
- package/package.json +9 -121
- package/.github/workflows/ci.yml +0 -48
- package/.github/workflows/mirai-graph-validate.yml +0 -30
- package/CHANGELOG.md +0 -702
- package/CITATION.cff +0 -21
- package/LICENSE +0 -21
- package/LICENSE-DOCS +0 -26
- package/README.md +0 -351
- package/ROADMAP.md +0 -241
- package/benchmarks/protocols/measure-convert-optimize.md +0 -131
- package/benchmarks/synthetic-context-reduction-v0/README.md +0 -70
- package/benchmarks/synthetic-context-reduction-v0/RESULT.md +0 -52
- package/benchmarks/synthetic-context-reduction-v0/expected/context-pack-compact.md +0 -31
- package/benchmarks/synthetic-context-reduction-v0/gates/results.json +0 -12
- package/benchmarks/synthetic-context-reduction-v0/graph/objects.json +0 -114
- package/benchmarks/synthetic-context-reduction-v0/graph/relations.json +0 -74
- package/benchmarks/synthetic-context-reduction-v0/graph.json +0 -37
- package/benchmarks/synthetic-context-reduction-v0/metrics/example-metrics.json +0 -22
- package/benchmarks/synthetic-context-reduction-v0/results/baseline-comparison-result.json +0 -42
- package/benchmarks/synthetic-context-reduction-v0/results/context-pack.json +0 -181
- package/benchmarks/synthetic-context-reduction-v0/results/context-reduction-result.json +0 -8
- package/benchmarks/synthetic-context-reduction-v0/results/profile-conformance-result.json +0 -28
- package/benchmarks/synthetic-context-reduction-v0/results/readiness-score.json +0 -24
- package/benchmarks/synthetic-context-reduction-v0/reviews/semantic-completeness-review.json +0 -78
- package/benchmarks/synthetic-context-reduction-v0/scripts/calculate-context-reduction.js +0 -42
- package/benchmarks/synthetic-context-reduction-v0/source-corpus/audit-events.md +0 -8
- package/benchmarks/synthetic-context-reduction-v0/source-corpus/content-workflow.md +0 -8
- package/benchmarks/synthetic-context-reduction-v0/source-corpus/identity-access.md +0 -8
- package/benchmarks/synthetic-context-reduction-v0/source-corpus/notification-delivery.md +0 -8
- package/benchmarks/synthetic-context-reduction-v0/tasks/tasks.json +0 -31
- package/docs/README.md +0 -130
- package/docs/adoption/adopter-kit.md +0 -187
- package/docs/adoption/ai-employee-graph.md +0 -151
- package/docs/adoption/character-layer.md +0 -196
- package/docs/adoption/choose-profile.md +0 -106
- package/docs/adoption/cli.md +0 -134
- package/docs/adoption/connect-project-15-minutes.md +0 -122
- package/docs/adoption/developer-integration-guide.md +0 -122
- package/docs/adoption/end-to-end-control-loop.md +0 -168
- package/docs/adoption/for-developers.md +0 -210
- package/docs/adoption/getting-started.md +0 -192
- package/docs/adoption/mirai-graph-transition.md +0 -67
- package/docs/adoption/profile-conformance-fixtures.md +0 -112
- package/docs/adoption/seed-to-validated-package.md +0 -121
- package/docs/concept.md +0 -109
- package/docs/repository-purpose.md +0 -422
- package/docs/research/ai-work-field-instrumentation-bridge.md +0 -126
- package/docs/research/baseline-comparison-protocol.md +0 -79
- package/docs/research/evidence-package-v0.1.md +0 -99
- package/docs/research/evidence-package-v0.2.md +0 -150
- package/docs/research/evidence-package-v0.3.md +0 -256
- package/docs/research/independent-implementation-pilot-plan.md +0 -74
- package/docs/research/limitations-and-threats.md +0 -40
- package/docs/research/practice-science-program.md +0 -232
- package/docs/research/scientific-evidence-package.md +0 -188
- package/docs/research/semantic-completeness-review-protocol.md +0 -70
- package/docs/terminology.md +0 -119
- package/docs/transfer/ai-employee-profile-proposal.md +0 -119
- package/docs/transfer/federation-routing-control-loop-2026-05-31.md +0 -28
- package/docs/transfer/graph-capability-map-2026-05-29.md +0 -126
- package/docs/transfer/graph-skill-to-mirai-graph.md +0 -128
- package/docs/transfer/project-management-standard-harvest-2026-06-02.md +0 -322
- package/docs/transfer/skill-graph-standard-harvest-2026-05-31.md +0 -113
- package/docs/transfer/standard-gap-report-2026-05-28.md +0 -208
- package/examples/ai-employee-minimal/README.md +0 -53
- package/examples/ai-employee-minimal/gates/results.json +0 -35
- package/examples/ai-employee-minimal/graph/objects.json +0 -187
- package/examples/ai-employee-minimal/graph/relations.json +0 -167
- package/examples/ai-employee-minimal/graph.json +0 -37
- package/examples/ai-employee-minimal/results/profile-conformance-result.json +0 -28
- package/examples/character-layer-integration-minimal/README.md +0 -25
- package/examples/character-layer-integration-minimal/results/character-layer-integration.json +0 -53
- package/examples/character-layer-minimal/README.md +0 -29
- package/examples/character-layer-minimal/gates/results.json +0 -57
- package/examples/character-layer-minimal/graph/objects.json +0 -165
- package/examples/character-layer-minimal/graph/relations.json +0 -178
- package/examples/character-layer-minimal/graph.json +0 -37
- package/examples/character-layer-readiness-1-0/README.md +0 -27
- package/examples/character-layer-readiness-1-0/results/character-layer-readiness.json +0 -90
- package/examples/dynamic-episode-minimal/README.md +0 -34
- package/examples/dynamic-episode-minimal/gates/results.json +0 -12
- package/examples/dynamic-episode-minimal/graph/objects.json +0 -92
- package/examples/dynamic-episode-minimal/graph/relations.json +0 -29
- package/examples/dynamic-episode-minimal/graph.json +0 -47
- package/examples/dynamic-episode-minimal/invalid-canonical-write-allowed.json +0 -40
- package/examples/dynamic-episode-minimal/invalid-evidence-as-authorization.json +0 -46
- package/examples/dynamic-episode-minimal/invalid-missing-event.json +0 -35
- package/examples/dynamic-episode-minimal/invalid-missing-selected-path.json +0 -40
- package/examples/dynamic-episode-minimal/invalid-unclassified-finding.json +0 -50
- package/examples/dynamic-episode-minimal/results/dynamic-episode-trace.json +0 -149
- package/examples/federation-routing-smoke/README.md +0 -19
- package/examples/federation-routing-smoke/federation-health-dashboard.json +0 -42
- package/examples/federation-routing-smoke/route-explanation.json +0 -32
- package/examples/federation-routing-smoke/route-regression-result.json +0 -35
- package/examples/federation-routing-smoke/routes/production-deploy-execution-evidence.json +0 -17
- package/examples/federation-routing-smoke/routes/production-deploy-route-result.json +0 -12
- package/examples/federation-routing-smoke/routes/production-deploy-runtime-preflight.json +0 -8
- package/examples/federation-routing-smoke/routes/production-deploy-stderr.txt +0 -1
- package/examples/federation-routing-smoke/routes/production-deploy-stdout.txt +0 -1
- package/examples/federation-routing-smoke/routes/search-page-execution-evidence.json +0 -17
- package/examples/federation-routing-smoke/routes/search-page-route-result.json +0 -12
- package/examples/federation-routing-smoke/routes/search-page-stderr.txt +0 -1
- package/examples/federation-routing-smoke/routes/search-page-stdout.txt +0 -1
- package/examples/federation-routing-smoke/routing-fixture-run.json +0 -66
- package/examples/federation-routing-smoke/routing-fixtures.json +0 -44
- package/examples/goal-vector-quality-control-minimal/README.md +0 -22
- package/examples/goal-vector-quality-control-minimal/gates/results.json +0 -22
- package/examples/goal-vector-quality-control-minimal/graph/objects.json +0 -56
- package/examples/goal-vector-quality-control-minimal/graph/relations.json +0 -29
- package/examples/goal-vector-quality-control-minimal/graph.json +0 -41
- package/examples/goal-vector-quality-control-minimal/invalid-complete-without-evidence.json +0 -77
- package/examples/goal-vector-quality-control-minimal/invalid-correction-without-route.json +0 -86
- package/examples/goal-vector-quality-control-minimal/invalid-missing-reverse-audit.json +0 -77
- package/examples/goal-vector-quality-control-minimal/invalid-missing-vector-link.json +0 -62
- package/examples/goal-vector-quality-control-minimal/invalid-tests-as-acceptance.json +0 -72
- package/examples/goal-vector-quality-control-minimal/results/goal-vector-quality-control.json +0 -130
- package/examples/graph-dna-alignment-minimal/README.md +0 -16
- package/examples/graph-dna-alignment-minimal/graph/objects.json +0 -38
- package/examples/graph-dna-alignment-minimal/graph/relations.json +0 -20
- package/examples/graph-dna-alignment-minimal/graph.json +0 -37
- package/examples/graph-dna-alignment-minimal/results/graph-dna-alignment.json +0 -32
- package/examples/graph-seed-minimal/README.md +0 -9
- package/examples/graph-seed-minimal/graph-embryo.json +0 -63
- package/examples/graph-seed-minimal/graph-seed.json +0 -60
- package/examples/implementation-control-cycles/README.md +0 -47
- package/examples/implementation-control-cycles/gates/results.json +0 -22
- package/examples/implementation-control-cycles/graph/objects.json +0 -119
- package/examples/implementation-control-cycles/graph/relations.json +0 -200
- package/examples/implementation-control-cycles/graph.json +0 -37
- package/examples/implementation-control-cycles/results/implementation-control-cycles.json +0 -456
- package/examples/implementation-control-minimal/README.md +0 -39
- package/examples/implementation-control-minimal/gates/results.json +0 -42
- package/examples/implementation-control-minimal/graph/objects.json +0 -128
- package/examples/implementation-control-minimal/graph/relations.json +0 -128
- package/examples/implementation-control-minimal/graph.json +0 -37
- package/examples/implementation-control-minimal/results/implementation-control-loop.json +0 -21
- package/examples/instrumentation-layer-minimal/README.md +0 -32
- package/examples/instrumentation-layer-minimal/gates/results.json +0 -11
- package/examples/instrumentation-layer-minimal/graph/objects.json +0 -74
- package/examples/instrumentation-layer-minimal/graph/relations.json +0 -56
- package/examples/instrumentation-layer-minimal/graph.json +0 -37
- package/examples/instrumentation-layer-minimal/invalid-cockpit-missing-gates.json +0 -40
- package/examples/instrumentation-layer-minimal/invalid-feedback-accepted-with-blocking.json +0 -38
- package/examples/instrumentation-layer-minimal/invalid-feedback-process-improvement-without-kaizen.json +0 -38
- package/examples/instrumentation-layer-minimal/invalid-traceability-missing-evidence.json +0 -43
- package/examples/instrumentation-layer-minimal/results/development-cockpit.json +0 -68
- package/examples/instrumentation-layer-minimal/results/feature-implementation-traceability.json +0 -56
- package/examples/instrumentation-layer-minimal/results/multi-source-quality-feedback.json +0 -72
- package/examples/invalid-character-layer-context-authorization/graph/objects.json +0 -22
- package/examples/invalid-character-layer-context-authorization/graph/relations.json +0 -1
- package/examples/invalid-character-layer-context-authorization/graph.json +0 -35
- package/examples/invalid-character-layer-correction-loop-no-review/graph/objects.json +0 -22
- package/examples/invalid-character-layer-correction-loop-no-review/graph/relations.json +0 -1
- package/examples/invalid-character-layer-correction-loop-no-review/graph.json +0 -35
- package/examples/invalid-character-layer-feedback-auto-update/graph/objects.json +0 -22
- package/examples/invalid-character-layer-feedback-auto-update/graph/relations.json +0 -1
- package/examples/invalid-character-layer-feedback-auto-update/graph.json +0 -35
- package/examples/invalid-character-layer-object-kind/graph/objects.json +0 -22
- package/examples/invalid-character-layer-object-kind/graph/relations.json +0 -1
- package/examples/invalid-character-layer-object-kind/graph.json +0 -35
- package/examples/invalid-character-layer-relation-direction/graph/objects.json +0 -33
- package/examples/invalid-character-layer-relation-direction/graph/relations.json +0 -13
- package/examples/invalid-character-layer-relation-direction/graph.json +0 -35
- package/examples/invalid-character-layer-relation-type/graph/objects.json +0 -33
- package/examples/invalid-character-layer-relation-type/graph/relations.json +0 -13
- package/examples/invalid-character-layer-relation-type/graph.json +0 -35
- package/examples/invalid-character-layer-role-permission/graph/objects.json +0 -22
- package/examples/invalid-character-layer-role-permission/graph/relations.json +0 -1
- package/examples/invalid-character-layer-role-permission/graph.json +0 -35
- package/examples/invalid-context-pack-missing-explanation/context-pack.json +0 -25
- package/examples/invalid-missing-relation-target/graph/objects.json +0 -11
- package/examples/invalid-missing-relation-target/graph/relations.json +0 -11
- package/examples/invalid-missing-relation-target/graph.json +0 -32
- package/examples/invalid-profile-object-kind/graph/objects.json +0 -20
- package/examples/invalid-profile-object-kind/graph/relations.json +0 -1
- package/examples/invalid-profile-object-kind/graph.json +0 -32
- package/examples/invalid-profile-relation-type/graph/objects.json +0 -29
- package/examples/invalid-profile-relation-type/graph/relations.json +0 -11
- package/examples/invalid-profile-relation-type/graph.json +0 -32
- package/examples/invalid-relation-id-mismatch/graph/objects.json +0 -29
- package/examples/invalid-relation-id-mismatch/graph/relations.json +0 -11
- package/examples/invalid-relation-id-mismatch/graph.json +0 -32
- package/examples/invalid-seed-unsafe-write/graph-seed.json +0 -27
- package/examples/invalid-societal-governance-auto-learning-update/graph/objects.json +0 -29
- package/examples/invalid-societal-governance-auto-learning-update/graph/relations.json +0 -11
- package/examples/invalid-societal-governance-auto-learning-update/graph.json +0 -35
- package/examples/invalid-societal-governance-avatar-no-consent/graph/objects.json +0 -29
- package/examples/invalid-societal-governance-avatar-no-consent/graph/relations.json +0 -11
- package/examples/invalid-societal-governance-avatar-no-consent/graph.json +0 -35
- package/examples/invalid-societal-governance-generated-context-authorization/graph/objects.json +0 -38
- package/examples/invalid-societal-governance-generated-context-authorization/graph/relations.json +0 -20
- package/examples/invalid-societal-governance-generated-context-authorization/graph.json +0 -35
- package/examples/invalid-societal-governance-missing-appeal-path/graph/objects.json +0 -29
- package/examples/invalid-societal-governance-missing-appeal-path/graph/relations.json +0 -11
- package/examples/invalid-societal-governance-missing-appeal-path/graph.json +0 -35
- package/examples/invalid-societal-governance-private-trace-exposed/graph/objects.json +0 -29
- package/examples/invalid-societal-governance-private-trace-exposed/graph/relations.json +0 -11
- package/examples/invalid-societal-governance-private-trace-exposed/graph.json +0 -35
- package/examples/invalid-societal-governance-rights-overridden/graph/objects.json +0 -29
- package/examples/invalid-societal-governance-rights-overridden/graph/relations.json +0 -11
- package/examples/invalid-societal-governance-rights-overridden/graph.json +0 -35
- package/examples/launch-record-minimal/README.md +0 -29
- package/examples/launch-record-minimal/gates/results.json +0 -12
- package/examples/launch-record-minimal/graph/objects.json +0 -47
- package/examples/launch-record-minimal/graph/relations.json +0 -38
- package/examples/launch-record-minimal/graph.json +0 -34
- package/examples/launch-record-minimal/results/launch-record.json +0 -51
- package/examples/managed-project-control-loop/README.md +0 -43
- package/examples/managed-project-control-loop/gates/results.json +0 -22
- package/examples/managed-project-control-loop/graph/objects.json +0 -119
- package/examples/managed-project-control-loop/graph/relations.json +0 -110
- package/examples/managed-project-control-loop/graph.json +0 -37
- package/examples/managed-project-control-loop/results/managed-loop-result.json +0 -21
- package/examples/minimal-graph/README.md +0 -15
- package/examples/minimal-graph/gates/results.json +0 -12
- package/examples/minimal-graph/graph/objects.json +0 -24
- package/examples/minimal-graph/graph/relations.json +0 -11
- package/examples/minimal-graph/graph.json +0 -37
- package/examples/minimal-graph/results/profile-conformance-result.json +0 -26
- package/examples/model-portability-minimal/README.md +0 -15
- package/examples/model-portability-minimal/results/model-portability-evidence.json +0 -55
- package/examples/organization-governance-minimal/README.md +0 -29
- package/examples/organization-governance-minimal/gates/results.json +0 -21
- package/examples/organization-governance-minimal/graph/objects.json +0 -147
- package/examples/organization-governance-minimal/graph/relations.json +0 -147
- package/examples/organization-governance-minimal/graph.json +0 -37
- package/examples/organization-governance-minimal/results/profile-conformance-result.json +0 -31
- package/examples/process-control-contract-minimal/README.md +0 -19
- package/examples/process-control-contract-minimal/graph/objects.json +0 -38
- package/examples/process-control-contract-minimal/graph/relations.json +0 -29
- package/examples/process-control-contract-minimal/graph.json +0 -34
- package/examples/process-control-contract-minimal/results/process-control-contract.json +0 -58
- package/examples/process-transition-minimal/README.md +0 -25
- package/examples/process-transition-minimal/invalid-missing-launch-record.json +0 -14
- package/examples/process-transition-minimal/invalid-ready-to-written.json +0 -14
- package/examples/process-transition-minimal/invalid-release-missing-evidence.json +0 -14
- package/examples/process-transition-minimal/invalid-sync-to-update.json +0 -14
- package/examples/process-transition-minimal/invalid-terminal-missing-kaizen.json +0 -14
- package/examples/process-transition-minimal/invalid-tests-to-approved.json +0 -14
- package/examples/process-transition-minimal/results/transition-explanation-invalid-ready-to-written.json +0 -35
- package/examples/process-transition-minimal/results/transition-explanation-valid.json +0 -34
- package/examples/process-transition-minimal/state-machine.json +0 -79
- package/examples/process-transition-minimal/transition-request-skip-kaizen.json +0 -14
- package/examples/process-transition-minimal/transition-request.json +0 -14
- package/examples/project-technology-context-traversal/README.md +0 -17
- package/examples/project-technology-context-traversal/graph/objects.json +0 -78
- package/examples/project-technology-context-traversal/graph/relations.json +0 -47
- package/examples/project-technology-context-traversal/graph.json +0 -30
- package/examples/project-technology-context-traversal/selection.example.json +0 -29
- package/examples/project-technology-context-traversal/sources/announcement.md +0 -3
- package/examples/project-technology-context-traversal/sources/release-guide.md +0 -3
- package/examples/project-technology-context-traversal/sources/release-smoke.md +0 -3
- package/examples/project-technology-context-traversal/sources/rollback-policy.md +0 -3
- package/examples/risk-and-coordination-minimal/README.md +0 -16
- package/examples/risk-and-coordination-minimal/graph/objects.json +0 -47
- package/examples/risk-and-coordination-minimal/graph/relations.json +0 -29
- package/examples/risk-and-coordination-minimal/graph.json +0 -37
- package/examples/risk-and-coordination-minimal/results/multi-agent-coordination.json +0 -25
- package/examples/risk-and-coordination-minimal/results/risk-control-matrix.json +0 -34
- package/examples/self-service-onboarding/bootstrap-proposal/bootstrap-proposal.json +0 -20
- package/examples/self-service-onboarding/existing-graph/README.md +0 -4
- package/examples/self-service-onboarding/existing-graph/gates/results.json +0 -11
- package/examples/self-service-onboarding/existing-graph/graph/objects.json +0 -11
- package/examples/self-service-onboarding/existing-graph/graph/relations.json +0 -1
- package/examples/self-service-onboarding/existing-graph/graph.json +0 -36
- package/examples/self-service-onboarding/no-graph/README.md +0 -6
- package/examples/self-service-onboarding/no-graph/package.json +0 -6
- package/examples/self-service-onboarding/no-graph/src/index.js +0 -3
- package/examples/self-service-onboarding/stale-graph/README.md +0 -4
- package/examples/self-service-onboarding/stale-graph/graph.json +0 -36
- package/examples/semantic-intent-resolution-minimal/README.md +0 -13
- package/examples/semantic-intent-resolution-minimal/invalid-low-confidence-executes.json +0 -26
- package/examples/semantic-intent-resolution-minimal/invalid-proposal-canonical-update.json +0 -27
- package/examples/semantic-intent-resolution-minimal/results/semantic-intent-resolution.json +0 -45
- package/examples/skill-runtime-minimal/README.md +0 -29
- package/examples/skill-runtime-minimal/gates/results.json +0 -35
- package/examples/skill-runtime-minimal/graph/objects.json +0 -209
- package/examples/skill-runtime-minimal/graph/relations.json +0 -178
- package/examples/skill-runtime-minimal/graph.json +0 -37
- package/examples/skill-runtime-minimal/results/profile-conformance-result.json +0 -27
- package/examples/societal-governance-minimal/README.md +0 -37
- package/examples/societal-governance-minimal/graph/objects.json +0 -218
- package/examples/societal-governance-minimal/graph/relations.json +0 -209
- package/examples/societal-governance-minimal/graph.json +0 -37
- package/examples/source-boundary-minimal/README.md +0 -16
- package/examples/source-boundary-minimal/graph/objects.json +0 -38
- package/examples/source-boundary-minimal/graph/relations.json +0 -20
- package/examples/source-boundary-minimal/graph.json +0 -37
- package/examples/source-boundary-minimal/results/source-boundary-contract.json +0 -37
- package/examples/technology-quality-feedback-minimal/README.md +0 -33
- package/examples/technology-quality-feedback-minimal/graph/objects.json +0 -56
- package/examples/technology-quality-feedback-minimal/graph/relations.json +0 -47
- package/examples/technology-quality-feedback-minimal/graph.json +0 -34
- package/examples/technology-quality-feedback-minimal/invalid-accepted-with-blocking.json +0 -33
- package/examples/technology-quality-feedback-minimal/invalid-evidence-as-authorization.json +0 -22
- package/examples/technology-quality-feedback-minimal/invalid-missing-required-step.json +0 -22
- package/examples/technology-quality-feedback-minimal/invalid-process-improvement-without-kaizen.json +0 -33
- package/examples/technology-quality-feedback-minimal/invalid-spec-gap-without-route.json +0 -33
- package/examples/technology-quality-feedback-minimal/invalid-unclassified-finding.json +0 -33
- package/examples/technology-quality-feedback-minimal/results/technology-quality-feedback.json +0 -80
- package/examples/work-recovery-minimal/README.md +0 -15
- package/examples/work-recovery-minimal/graph/objects.json +0 -47
- package/examples/work-recovery-minimal/graph/relations.json +0 -20
- package/examples/work-recovery-minimal/graph.json +0 -37
- package/examples/work-recovery-minimal/results/recovery-resume-record.json +0 -17
- package/examples/work-recovery-minimal/results/work-state-machine.json +0 -21
- package/packages/cli/adopter-workflow.js +0 -228
- package/packages/cli/context-pack.js +0 -269
- package/packages/cli/graph-manifest.js +0 -367
- package/packages/cli/instrumentation-report.js +0 -97
- package/packages/cli/migrate-graph-manifest.js +0 -33
- package/packages/cli/mirai-graph.js +0 -154
- package/packages/cli/mirai_graph.js +0 -3
- package/packages/cli/playground-demo.js +0 -114
- package/packages/cli/project-technology.js +0 -129
- package/packages/cli/readiness-score.js +0 -164
- package/packages/cli/release-state.js +0 -329
- package/packages/cli/seed-preview.js +0 -78
- package/packages/cli/self-service-onboarding.js +0 -386
- package/packages/cli/validate-adopter-workflow.js +0 -63
- package/packages/cli/validate-artifact-releases.js +0 -282
- package/packages/cli/validate-baseline-comparison.js +0 -105
- package/packages/cli/validate-context-traversal.js +0 -292
- package/packages/cli/validate-graph-manifest-migration.js +0 -64
- package/packages/cli/validate-mirai-graph.js +0 -3245
- package/packages/cli/validate-process-transition-report.js +0 -105
- package/packages/cli/validate-profile-results.js +0 -64
- package/packages/cli/validate-project-continuity.js +0 -173
- package/packages/cli/validate-project-technology.js +0 -296
- package/packages/cli/validate-release-state.js +0 -100
- package/packages/cli/validate-routing-control-examples.js +0 -79
- package/packages/cli/validate-self-service-onboarding.js +0 -159
- package/packages/project-technology/artifact-release.js +0 -738
- package/packages/project-technology/context-traversal.js +0 -684
- package/packages/project-technology/continuity.js +0 -414
- package/packages/project-technology/index.js +0 -835
- package/pilots/independent-implementation-001-conference-planning/README.md +0 -40
- package/pilots/independent-implementation-001-conference-planning/gates/results.json +0 -12
- package/pilots/independent-implementation-001-conference-planning/graph/objects.json +0 -74
- package/pilots/independent-implementation-001-conference-planning/graph/relations.json +0 -56
- package/pilots/independent-implementation-001-conference-planning/graph-seed.json +0 -65
- package/pilots/independent-implementation-001-conference-planning/graph.json +0 -37
- package/pilots/independent-implementation-001-conference-planning/reports/pilot-report.md +0 -120
- package/pilots/independent-implementation-001-conference-planning/results/context-pack.json +0 -35
- package/pilots/independent-implementation-001-conference-planning/results/graph-embryo.json +0 -81
- package/pilots/independent-implementation-001-conference-planning/results/package-validation.json +0 -7
- package/pilots/independent-implementation-001-conference-planning/results/profile-conformance-result.json +0 -28
- package/pilots/independent-implementation-001-conference-planning/results/readiness-score.json +0 -26
- package/pilots/independent-implementation-001-conference-planning/results/seed-validation.json +0 -7
- package/pilots/independent-implementation-002-software-specification/README.md +0 -40
- package/pilots/independent-implementation-002-software-specification/gates/results.json +0 -22
- package/pilots/independent-implementation-002-software-specification/graph/objects.json +0 -101
- package/pilots/independent-implementation-002-software-specification/graph/relations.json +0 -92
- package/pilots/independent-implementation-002-software-specification/graph-seed.json +0 -72
- package/pilots/independent-implementation-002-software-specification/graph.json +0 -37
- package/pilots/independent-implementation-002-software-specification/reports/pilot-report.md +0 -142
- package/pilots/independent-implementation-002-software-specification/results/context-pack.json +0 -184
- package/pilots/independent-implementation-002-software-specification/results/graph-embryo.json +0 -90
- package/pilots/independent-implementation-002-software-specification/results/package-validation.json +0 -7
- package/pilots/independent-implementation-002-software-specification/results/profile-conformance-result.json +0 -28
- package/pilots/independent-implementation-002-software-specification/results/readiness-score.json +0 -26
- package/pilots/independent-implementation-002-software-specification/results/seed-validation.json +0 -7
- package/pilots/independent-implementation-002-software-specification/reviews/semantic-completeness-review.json +0 -81
- package/pilots/independent-implementation-003-ai-employee-workflow/README.md +0 -42
- package/pilots/independent-implementation-003-ai-employee-workflow/gates/results.json +0 -30
- package/pilots/independent-implementation-003-ai-employee-workflow/graph/objects.json +0 -156
- package/pilots/independent-implementation-003-ai-employee-workflow/graph/relations.json +0 -147
- package/pilots/independent-implementation-003-ai-employee-workflow/graph-seed.json +0 -90
- package/pilots/independent-implementation-003-ai-employee-workflow/graph.json +0 -37
- package/pilots/independent-implementation-003-ai-employee-workflow/reports/pilot-report.md +0 -49
- package/pilots/independent-implementation-003-ai-employee-workflow/results/profile-conformance-result.json +0 -30
- package/pilots/independent-implementation-004-research-program/README.md +0 -41
- package/pilots/independent-implementation-004-research-program/gates/results.json +0 -21
- package/pilots/independent-implementation-004-research-program/graph/objects.json +0 -102
- package/pilots/independent-implementation-004-research-program/graph/relations.json +0 -84
- package/pilots/independent-implementation-004-research-program/graph-seed.json +0 -76
- package/pilots/independent-implementation-004-research-program/graph.json +0 -37
- package/pilots/independent-implementation-004-research-program/reports/pilot-report.md +0 -50
- package/pilots/independent-implementation-004-research-program/results/profile-conformance-result.json +0 -30
- package/pilots/independent-implementation-005-organization-governance/README.md +0 -42
- package/pilots/independent-implementation-005-organization-governance/gates/results.json +0 -20
- package/pilots/independent-implementation-005-organization-governance/graph/objects.json +0 -137
- package/pilots/independent-implementation-005-organization-governance/graph/relations.json +0 -110
- package/pilots/independent-implementation-005-organization-governance/graph-seed.json +0 -97
- package/pilots/independent-implementation-005-organization-governance/graph.json +0 -37
- package/pilots/independent-implementation-005-organization-governance/reports/pilot-report.md +0 -47
- package/pilots/independent-implementation-005-organization-governance/results/profile-conformance-result.json +0 -29
- package/playground/README.md +0 -78
- package/playground/demo-report.md +0 -84
- package/profiles/README.md +0 -28
- package/profiles/ai-employee/README.md +0 -132
- package/profiles/ai-employee/profile.json +0 -58
- package/profiles/character-layer/README.md +0 -143
- package/profiles/character-layer/profile.json +0 -46
- package/profiles/implementation-control/README.md +0 -174
- package/profiles/implementation-control/profile.json +0 -108
- package/profiles/organization-governance/README.md +0 -60
- package/profiles/organization-governance/profile.json +0 -56
- package/profiles/project-management/README.md +0 -119
- package/profiles/project-management/profile.json +0 -38
- package/profiles/skill-runtime/README.md +0 -99
- package/profiles/skill-runtime/profile.json +0 -58
- package/profiles/societal-governance/README.md +0 -129
- package/profiles/societal-governance/profile.json +0 -121
- package/profiles/software-specification/README.md +0 -142
- package/profiles/software-specification/profile.json +0 -31
- package/publications/README.md +0 -39
- package/publications/observable-self-correcting-ai-workflows/README.md +0 -105
- package/publications/preprint-note.md +0 -11
- package/publications/preprint-outline.md +0 -45
- package/publications/semantic-intent-goal-vector-control/README.md +0 -99
- package/releases/0.1.0-alpha.0.md +0 -45
- package/releases/0.1.0-alpha.1.md +0 -63
- package/releases/0.1.0-alpha.10.md +0 -93
- package/releases/0.1.0-alpha.11.md +0 -114
- package/releases/0.1.0-alpha.2.md +0 -37
- package/releases/0.1.0-alpha.3.md +0 -61
- package/releases/0.1.0-alpha.4.md +0 -53
- package/releases/0.1.0-alpha.5.md +0 -48
- package/releases/0.1.0-alpha.6.md +0 -96
- package/releases/0.1.0-alpha.7.md +0 -114
- package/releases/0.1.0-alpha.8.md +0 -92
- package/releases/0.1.0-alpha.9.md +0 -80
- package/releases/1.0.0-rc.1.md +0 -121
- package/releases/1.0.0-rc.10.md +0 -14
- package/releases/1.0.0-rc.11.md +0 -14
- package/releases/1.0.0-rc.2.md +0 -79
- package/releases/1.0.0-rc.3.md +0 -51
- package/releases/1.0.0-rc.4.md +0 -70
- package/releases/1.0.0-rc.5.md +0 -88
- package/releases/1.0.0-rc.6.md +0 -76
- package/releases/1.0.0-rc.8.md +0 -17
- package/releases/1.0.0-rc.9.md +0 -14
- package/releases/1.0.0.md +0 -23
- package/releases/1.1.0.md +0 -36
- package/releases/1.1.1.md +0 -25
- package/releases/1.2.0.md +0 -19
- package/releases/1.3.0.md +0 -16
- package/releases/README.md +0 -135
- package/releases/societal-governance-profile-proposal.md +0 -45
- package/schemas/baseline-comparison-result.schema.json +0 -87
- package/schemas/character-layer-integration.schema.json +0 -112
- package/schemas/character-layer-readiness.schema.json +0 -73
- package/schemas/context-pack.schema.json +0 -190
- package/schemas/context-traversal-receipt.schema.json +0 -64
- package/schemas/development-cockpit.schema.json +0 -74
- package/schemas/dynamic-episode-trace.schema.json +0 -153
- package/schemas/feature-implementation-traceability.schema.json +0 -80
- package/schemas/federation-health-dashboard.schema.json +0 -47
- package/schemas/gate-result.schema.json +0 -44
- package/schemas/goal-vector-quality-control.schema.json +0 -131
- package/schemas/graph-dna-alignment.schema.json +0 -49
- package/schemas/graph-embryo.schema.json +0 -51
- package/schemas/graph-lock.schema.json +0 -28
- package/schemas/graph-manifest.schema.json +0 -154
- package/schemas/graph-seed.schema.json +0 -137
- package/schemas/implementation-control-cycle.schema.json +0 -265
- package/schemas/implementation-control-loop.schema.json +0 -84
- package/schemas/launch-record.schema.json +0 -78
- package/schemas/model-portability-evidence.schema.json +0 -93
- package/schemas/multi-agent-coordination.schema.json +0 -35
- package/schemas/multi-source-quality-feedback.schema.json +0 -54
- package/schemas/object.schema.json +0 -49
- package/schemas/package-manifest.schema.json +0 -53
- package/schemas/process-control-contract.schema.json +0 -100
- package/schemas/process-transition-request.schema.json +0 -41
- package/schemas/profile.schema.json +0 -56
- package/schemas/project-technology-extension.schema.json +0 -15
- package/schemas/project-technology-target-export.schema.json +0 -35
- package/schemas/readiness-score.schema.json +0 -43
- package/schemas/recovery-resume-record.schema.json +0 -25
- package/schemas/relation.schema.json +0 -43
- package/schemas/risk-control-matrix.schema.json +0 -36
- package/schemas/route-explanation.schema.json +0 -51
- package/schemas/route-regression-result.schema.json +0 -33
- package/schemas/routing-fixture-run.schema.json +0 -45
- package/schemas/routing-fixtures.schema.json +0 -59
- package/schemas/semantic-intent-resolution.schema.json +0 -151
- package/schemas/source-boundary-contract.schema.json +0 -31
- package/schemas/technology-quality-feedback.schema.json +0 -116
- package/schemas/work-state-machine.schema.json +0 -34
- package/standard/action-runtime-boundary.md +0 -99
- package/standard/adoption-levels.md +0 -69
- package/standard/conformance-levels.md +0 -133
- package/standard/context-pack-generation.md +0 -184
- package/standard/development-cockpit.md +0 -67
- package/standard/dynamic-episode-layer.md +0 -113
- package/standard/dynamic-layer-code-generation.md +0 -87
- package/standard/episode-trace.md +0 -97
- package/standard/evidence-provenance.md +0 -128
- package/standard/feature-implementation-traceability.md +0 -68
- package/standard/federation-health.md +0 -42
- package/standard/feedback-learning-gate.md +0 -101
- package/standard/goal-vector-quality-control.md +0 -128
- package/standard/governance.md +0 -137
- package/standard/graph-as-ai-brain.md +0 -81
- package/standard/graph-dna-alignment.md +0 -50
- package/standard/graph-dna.md +0 -70
- package/standard/graph-embryo.md +0 -69
- package/standard/graph-seed.md +0 -122
- package/standard/hybrid-source-of-truth.md +0 -91
- package/standard/implementation-control-cycles.md +0 -194
- package/standard/implementation-control.md +0 -102
- package/standard/launch-record.md +0 -53
- package/standard/lifecycle-readiness.md +0 -159
- package/standard/multi-agent-coordination.md +0 -50
- package/standard/multi-source-quality-feedback.md +0 -71
- package/standard/object-model.md +0 -167
- package/standard/organization-governance.md +0 -83
- package/standard/process-control-contract.md +0 -53
- package/standard/profile-boundaries.md +0 -225
- package/standard/profiles.md +0 -253
- package/standard/project-technology.md +0 -186
- package/standard/projection-views.md +0 -69
- package/standard/recovery-resume.md +0 -49
- package/standard/relation-model.md +0 -149
- package/standard/risk-control-matrix.md +0 -53
- package/standard/route-explanation.md +0 -35
- package/standard/route-regression.md +0 -33
- package/standard/routing-fixtures.md +0 -54
- package/standard/runtime-enablement.md +0 -85
- package/standard/semantic-intent-resolution.md +0 -91
- package/standard/source-boundary-contract.md +0 -49
- package/standard/standard-v0.1.md +0 -132
- package/standard/technology-quality-feedback.md +0 -97
- package/standard/test-suite.md +0 -159
- package/standard/work-state-machine.md +0 -62
- package/templates/README.md +0 -77
- package/templates/ai-employee-starter/README.md +0 -9
- package/templates/ai-employee-starter/gates/results.json +0 -12
- package/templates/ai-employee-starter/graph/objects.json +0 -90
- package/templates/ai-employee-starter/graph/relations.json +0 -47
- package/templates/ai-employee-starter/graph.json +0 -37
- package/templates/character-layer-starter/README.md +0 -39
- package/templates/character-layer-starter/gates/results.json +0 -20
- package/templates/character-layer-starter/graph/objects.json +0 -308
- package/templates/character-layer-starter/graph/relations.json +0 -344
- package/templates/character-layer-starter/graph.json +0 -37
- package/templates/organization-governance-starter/README.md +0 -9
- package/templates/organization-governance-starter/gates/results.json +0 -12
- package/templates/organization-governance-starter/graph/objects.json +0 -112
- package/templates/organization-governance-starter/graph/relations.json +0 -65
- package/templates/organization-governance-starter/graph.json +0 -37
- package/templates/research-program-starter/README.md +0 -9
- package/templates/research-program-starter/gates/results.json +0 -12
- package/templates/research-program-starter/graph/objects.json +0 -79
- package/templates/research-program-starter/graph/relations.json +0 -47
- package/templates/research-program-starter/graph.json +0 -37
- package/templates/software-project-starter/README.md +0 -9
- package/templates/software-project-starter/gates/results.json +0 -12
- package/templates/software-project-starter/graph/objects.json +0 -79
- package/templates/software-project-starter/graph/relations.json +0 -47
- package/templates/software-project-starter/graph.json +0 -37
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
const crypto = require("crypto");
|
|
2
|
-
const fs = require("fs");
|
|
3
|
-
const path = require("path");
|
|
4
|
-
|
|
5
|
-
const SCHEMA_ID = "https://mirai-graph.dev/schemas/graph-manifest.schema.json";
|
|
6
|
-
const LEGACY_WORKSPACE_SCHEMA = "https://schemas.simai.io/mirai-graph/graph.schema.json";
|
|
7
|
-
const SCHEMA_VERSION = "2.0.0";
|
|
8
|
-
const FORMAT = "mirai-graph";
|
|
9
|
-
const MANIFEST_PATHS = ["graph.json", "graph/graph.json", "mirai-graph-package.json"];
|
|
10
|
-
const SCOPES = new Set(["skill", "repository", "workspace", "domain", "federation", "package"]);
|
|
11
|
-
const CONFORMANCE = new Set(["level_0", "level_1", "level_2", "level_3", "level_4"]);
|
|
12
|
-
|
|
13
|
-
const ROOT_V1_FIELDS = new Set(["$schema", "format", "schema_version", "workspace_id", "id", "scope", "title", "owner", "local", "imports"]);
|
|
14
|
-
const INNER_V1_FIELDS = new Set(["schema_version", "schemaVersion", "graph_id", "graphId", "legacyGraphIds", "title", "description", "graph_type", "type", "kind", "status", "owner", "ownerSkill", "domainOwnerSkills", "companionSkills", "profiles", "source_of_truth", "sourceOfTruth", "canonical_projection", "dna_path", "schemas_path", "generated_path", "source_path", "graph_runtime", "graphRuntime", "runtime_context", "management_profile", "federation", "evolution", "graph_kernel", "hybrid_sot", "source_boundary", "sourceBoundaries", "sourceInventory", "workflowIntegration", "objectIndexes", "relationIndexes", "generatedContextPacks", "generatedReports", "coverageReports", "readinessReports", "public_safety", "entrypoints", "skill", "spec", "spec_index", "entrypoint", "display_name", "model", "nodes", "edges"]);
|
|
15
|
-
const PACKAGE_V1_FIELDS = new Set(["schema_version", "schemaVersion", "id", "graph_id", "packageId", "legacyPackageId", "name", "title", "version", "profile", "profiles", "conformance_level", "graph", "description", "license", "public_safety", "nonclaims", "owner", "ownerSkill", "domainOwnerSkill", "hybridSot", "graphOnlyRuntimeAllowed", "createdAt", "status", "gates", "results"]);
|
|
16
|
-
const V2_FIELDS = new Set(["$schema", "format", "schema_version", "id", "aliases", "title", "scope", "kind", "owner", "profiles", "graph", "imports", "version", "conformance_level", "public_safety", "nonclaims", "federation", "runtime", "evolution", "extensions", "description", "license"]);
|
|
17
|
-
|
|
18
|
-
function readJson(filePath) {
|
|
19
|
-
return JSON.parse(fs.readFileSync(filePath, "utf8").replace(/^\uFEFF/, ""));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function jsonBytes(value) {
|
|
23
|
-
return `${JSON.stringify(value, null, 2)}\n`;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function sha256(value) {
|
|
27
|
-
const bytes = Buffer.isBuffer(value) ? value : Buffer.from(String(value));
|
|
28
|
-
return `sha256:${crypto.createHash("sha256").update(bytes).digest("hex")}`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function graphDataFingerprint(root) {
|
|
32
|
-
const digest = crypto.createHash("sha256");
|
|
33
|
-
let fileCount = 0;
|
|
34
|
-
let byteCount = 0;
|
|
35
|
-
const graphRoot = path.join(root, "graph");
|
|
36
|
-
function visit(directory) {
|
|
37
|
-
if (!fs.existsSync(directory)) return;
|
|
38
|
-
for (const name of fs.readdirSync(directory).sort()) {
|
|
39
|
-
const absolute = path.join(directory, name);
|
|
40
|
-
const stat = fs.statSync(absolute);
|
|
41
|
-
if (stat.isDirectory()) visit(absolute);
|
|
42
|
-
else {
|
|
43
|
-
const relative = path.relative(root, absolute).split(path.sep).join("/");
|
|
44
|
-
if (relative === "graph/graph.json") continue;
|
|
45
|
-
const data = fs.readFileSync(absolute);
|
|
46
|
-
digest.update(relative); digest.update("\0"); digest.update(data); digest.update("\0");
|
|
47
|
-
fileCount += 1; byteCount += data.length;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
visit(graphRoot);
|
|
52
|
-
return { file_count: fileCount, byte_count: byteCount, sha256: `sha256:${digest.digest("hex")}` };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function sortedUnique(values) {
|
|
56
|
-
return [...new Set(values.filter((value) => typeof value === "string" && value.trim()).map((value) => value.trim()))].sort();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function relativePath(value) {
|
|
60
|
-
if (typeof value !== "string" || value.trim() === "" || path.isAbsolute(value)) return false;
|
|
61
|
-
return !value.split(/[\\/]+/).includes("..");
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function detectManifestSources(repo) {
|
|
65
|
-
const sources = [];
|
|
66
|
-
for (const relative of MANIFEST_PATHS) {
|
|
67
|
-
const absolute = path.join(repo, relative);
|
|
68
|
-
if (!fs.existsSync(absolute)) continue;
|
|
69
|
-
const payload = readJson(absolute);
|
|
70
|
-
let format = "unknown";
|
|
71
|
-
if (relative === "graph.json" && payload.format === FORMAT && payload.schema_version === SCHEMA_VERSION) format = "root_v2";
|
|
72
|
-
else if (relative === "graph.json" && (payload.format === FORMAT || payload.$schema === LEGACY_WORKSPACE_SCHEMA)) format = "root_v1";
|
|
73
|
-
else if (relative === "graph/graph.json") format = "inner_v1";
|
|
74
|
-
else if (relative === "mirai-graph-package.json") format = "package_v1";
|
|
75
|
-
sources.push({ relative, absolute, format, payload, hash: sha256(fs.readFileSync(absolute)) });
|
|
76
|
-
}
|
|
77
|
-
return sources;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function unknownFields(source) {
|
|
81
|
-
const allowed = source.format === "root_v1" ? ROOT_V1_FIELDS : source.format === "inner_v1" ? INNER_V1_FIELDS : source.format === "package_v1" ? PACKAGE_V1_FIELDS : null;
|
|
82
|
-
return allowed ? Object.keys(source.payload).filter((key) => !allowed.has(key)).sort() : [];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function asPaths(value) {
|
|
86
|
-
if (Array.isArray(value)) return sortedUnique(value);
|
|
87
|
-
return typeof value === "string" && value.trim() ? [value.trim()] : [];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function normalizeImports(value) {
|
|
91
|
-
return (Array.isArray(value) ? value : []).map((source) => {
|
|
92
|
-
if (!source || typeof source !== "object" || Array.isArray(source)) return source;
|
|
93
|
-
const item = { ...source };
|
|
94
|
-
if (Array.isArray(item.raw_source_fallback)) {
|
|
95
|
-
const portable = item.raw_source_fallback.filter(relativePath);
|
|
96
|
-
const nonportable = item.raw_source_fallback.filter((entry) => typeof entry === "string" && !relativePath(entry));
|
|
97
|
-
item.raw_source_fallback = portable;
|
|
98
|
-
if (nonportable.length) {
|
|
99
|
-
item.extensions = { ...(item.extensions || {}), "simai.legacy": { nonportable_raw_source_fallback: nonportable } };
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return item;
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function validateManifest(manifest, repo = null) {
|
|
107
|
-
const errors = [];
|
|
108
|
-
for (const field of Object.keys(manifest || {})) {
|
|
109
|
-
if (!V2_FIELDS.has(field)) errors.push(`unknown v2 field ${field}`);
|
|
110
|
-
}
|
|
111
|
-
const requiredStrings = ["$schema", "format", "schema_version", "id", "title", "scope", "kind", "owner"];
|
|
112
|
-
for (const field of requiredStrings) {
|
|
113
|
-
if (typeof manifest[field] !== "string" || !manifest[field].trim()) errors.push(`${field} must be a non-empty string`);
|
|
114
|
-
}
|
|
115
|
-
if (manifest.$schema !== SCHEMA_ID) errors.push(`$schema must equal ${SCHEMA_ID}`);
|
|
116
|
-
if (manifest.format !== FORMAT) errors.push(`format must equal ${FORMAT}`);
|
|
117
|
-
if (manifest.schema_version !== SCHEMA_VERSION) errors.push(`schema_version must equal ${SCHEMA_VERSION}`);
|
|
118
|
-
if (!SCOPES.has(manifest.scope)) errors.push(`unsupported scope ${manifest.scope}`);
|
|
119
|
-
for (const field of ["aliases", "profiles", "imports"]) {
|
|
120
|
-
if (!Array.isArray(manifest[field])) errors.push(`${field} must be an array`);
|
|
121
|
-
}
|
|
122
|
-
if (Array.isArray(manifest.aliases) && new Set(manifest.aliases).size !== manifest.aliases.length) errors.push("aliases must be unique");
|
|
123
|
-
if (Array.isArray(manifest.profiles) && new Set(manifest.profiles).size !== manifest.profiles.length) errors.push("profiles must be unique");
|
|
124
|
-
const technology = manifest?.extensions?.["mirai.project_technology"];
|
|
125
|
-
if (technology !== undefined) {
|
|
126
|
-
if (!technology || typeof technology !== "object" || Array.isArray(technology)) errors.push("extensions.mirai.project_technology must be an object");
|
|
127
|
-
else {
|
|
128
|
-
const expected = {
|
|
129
|
-
contract_version: "1.0.0", context_policy: "task_scoped", source_boundary: "hybrid_sot",
|
|
130
|
-
};
|
|
131
|
-
for (const field of Object.keys(expected)) if (technology[field] !== expected[field]) errors.push(`extensions.mirai.project_technology.${field} is invalid`);
|
|
132
|
-
if (typeof technology.enabled !== "boolean") errors.push("extensions.mirai.project_technology.enabled is invalid");
|
|
133
|
-
if (technology.continuity_policy !== undefined && technology.continuity_policy !== "task_boundary") errors.push("extensions.mirai.project_technology.continuity_policy is invalid");
|
|
134
|
-
for (const field of Object.keys(technology)) if (!(field in expected) && !["enabled", "continuity_policy"].includes(field)) errors.push(`extensions.mirai.project_technology has unknown field ${field}`);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (manifest.graph !== null) {
|
|
138
|
-
if (!manifest.graph || typeof manifest.graph !== "object" || Array.isArray(manifest.graph)) {
|
|
139
|
-
errors.push("graph must be an object or null");
|
|
140
|
-
} else {
|
|
141
|
-
if (!relativePath(manifest.graph.root)) errors.push("graph.root must be a safe relative path");
|
|
142
|
-
for (const field of ["source_of_truth", "objects", "relations", "schemas", "generated", "raw_sources"]) {
|
|
143
|
-
if (!Array.isArray(manifest.graph[field])) errors.push(`graph.${field} must be an array`);
|
|
144
|
-
else for (const value of manifest.graph[field]) if (!relativePath(value)) errors.push(`graph.${field} contains unsafe path ${value}`);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
const aliases = new Set();
|
|
149
|
-
for (const [index, item] of (Array.isArray(manifest.imports) ? manifest.imports : []).entries()) {
|
|
150
|
-
if (!item || typeof item !== "object") { errors.push(`imports[${index}] must be an object`); continue; }
|
|
151
|
-
if (typeof item.alias !== "string" || !item.alias.trim()) errors.push(`imports[${index}].alias must be a non-empty string`);
|
|
152
|
-
else if (aliases.has(item.alias)) errors.push(`duplicate import alias ${item.alias}`);
|
|
153
|
-
else aliases.add(item.alias);
|
|
154
|
-
if (typeof item.graph_id !== "string" || !item.graph_id.trim()) errors.push(`imports[${index}].graph_id must be a non-empty string`);
|
|
155
|
-
if (!item.source || !["registry", "git", "file"].includes(item.source.type)) errors.push(`imports[${index}].source.type is invalid`);
|
|
156
|
-
}
|
|
157
|
-
if (manifest.scope === "package") {
|
|
158
|
-
if (typeof manifest.version !== "string" || !manifest.version.trim()) errors.push("package scope requires version");
|
|
159
|
-
if (!CONFORMANCE.has(manifest.conformance_level)) errors.push("package scope requires a supported conformance_level");
|
|
160
|
-
if (!manifest.graph || !manifest.graph.objects.length || !manifest.graph.relations.length) errors.push("package scope requires graph object and relation entrypoints");
|
|
161
|
-
}
|
|
162
|
-
if (repo && manifest.graph) {
|
|
163
|
-
for (const field of ["objects", "relations"]) {
|
|
164
|
-
for (const item of manifest.graph[field]) if (!fs.existsSync(path.join(repo, item))) errors.push(`missing graph.${field} entrypoint ${item}`);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return errors;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function migratePlan(repo, options = {}) {
|
|
171
|
-
const root = path.resolve(repo);
|
|
172
|
-
const sources = detectManifestSources(root);
|
|
173
|
-
const current = sources.find((source) => source.format === "root_v2");
|
|
174
|
-
if (current) {
|
|
175
|
-
const errors = validateManifest(current.payload, root);
|
|
176
|
-
return {
|
|
177
|
-
status: errors.length ? "fail" : "success",
|
|
178
|
-
manifest_status: errors.length ? "conflict" : "current",
|
|
179
|
-
source_formats: sources.map((item) => item.format),
|
|
180
|
-
target_schema_version: SCHEMA_VERSION,
|
|
181
|
-
migration_required: false,
|
|
182
|
-
identity_map: { canonical: current.payload.id, aliases: current.payload.aliases || [] },
|
|
183
|
-
conflicts: errors,
|
|
184
|
-
can_execute_now: errors.length === 0,
|
|
185
|
-
operation_mode: "read_only",
|
|
186
|
-
next_action: errors.length ? "repair the v2 manifest" : "none",
|
|
187
|
-
manifest: current.payload,
|
|
188
|
-
source_hashes: Object.fromEntries(sources.map((item) => [item.relative, item.hash]))
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
const known = sources.filter((source) => source.format !== "unknown");
|
|
192
|
-
const conflicts = [];
|
|
193
|
-
if (!known.length) conflicts.push("manifest_missing");
|
|
194
|
-
for (const source of known) {
|
|
195
|
-
const unknown = unknownFields(source);
|
|
196
|
-
if (unknown.length) conflicts.push(`review_required:${source.relative}:${unknown.join(",")}`);
|
|
197
|
-
}
|
|
198
|
-
const rootV1 = known.find((source) => source.format === "root_v1")?.payload;
|
|
199
|
-
const inner = known.find((source) => source.format === "inner_v1")?.payload;
|
|
200
|
-
const pkg = known.find((source) => source.format === "package_v1")?.payload;
|
|
201
|
-
const localIds = sortedUnique([inner?.graph_id || inner?.graphId, rootV1?.local?.graph_id]);
|
|
202
|
-
if (localIds.length > 1) conflicts.push(`manifest_identity_conflict:${localIds.join("!=")}`);
|
|
203
|
-
const id = localIds[0] || (inner?.skill ? `ai-codex-skill-${inner.skill}.graph` : null) || pkg?.id || rootV1?.workspace_id || rootV1?.id;
|
|
204
|
-
const aliases = sortedUnique([rootV1?.workspace_id, rootV1?.id, pkg?.id, pkg?.packageId, ...(Array.isArray(inner?.legacyGraphIds) ? inner.legacyGraphIds : [])].filter((value) => value && value !== id));
|
|
205
|
-
const owner = inner?.owner || rootV1?.owner || pkg?.owner || options.owner;
|
|
206
|
-
if (!owner) conflicts.push("needs_input:owner");
|
|
207
|
-
const profiles = sortedUnique([
|
|
208
|
-
...(Array.isArray(rootV1?.local?.profiles) ? rootV1.local.profiles : []),
|
|
209
|
-
...(Array.isArray(pkg?.profiles) ? pkg.profiles : []),
|
|
210
|
-
pkg?.profile,
|
|
211
|
-
inner?.graph_type,
|
|
212
|
-
...(Array.isArray(inner?.profiles) ? inner.profiles : [])
|
|
213
|
-
]);
|
|
214
|
-
const graphRoot = rootV1?.local?.path || "graph";
|
|
215
|
-
const hasLocalGraph = Boolean(inner || pkg || rootV1?.local || fs.existsSync(path.join(root, graphRoot)));
|
|
216
|
-
const objects = asPaths(pkg?.graph?.objects || inner?.objectIndexes || (fs.existsSync(path.join(root, graphRoot, "objects.json")) ? `${graphRoot}/objects.json` : []));
|
|
217
|
-
const relations = asPaths(pkg?.graph?.relations || inner?.relationIndexes || (fs.existsSync(path.join(root, graphRoot, "relations.json")) ? `${graphRoot}/relations.json` : []));
|
|
218
|
-
const sourceOfTruth = asPaths(inner?.source_of_truth || inner?.sourceOfTruth || inner?.spec || inner?.spec_index || inner?.entrypoint || (fs.existsSync(path.join(root, graphRoot, "specs")) ? `${graphRoot}/specs` : graphRoot));
|
|
219
|
-
const schemas = asPaths(inner?.schemas_path || (fs.existsSync(path.join(root, graphRoot, "schemas")) ? `${graphRoot}/schemas` : []));
|
|
220
|
-
const generated = sortedUnique([...asPaths(inner?.generated_path), ...asPaths(inner?.generatedContextPacks), ...asPaths(inner?.generatedReports), ...asPaths(inner?.coverageReports), ...asPaths(inner?.readinessReports)]);
|
|
221
|
-
const rawSources = sortedUnique([
|
|
222
|
-
...asPaths(inner?.source_path),
|
|
223
|
-
...asPaths(inner?.source_boundary),
|
|
224
|
-
...asPaths(inner?.sourceBoundaries),
|
|
225
|
-
...asPaths(inner?.sourceInventory),
|
|
226
|
-
...asPaths(inner?.workflowIntegration),
|
|
227
|
-
...asPaths(inner?.canonical_projection),
|
|
228
|
-
...(fs.existsSync(path.join(root, "technology")) ? ["technology"] : []),
|
|
229
|
-
...(fs.existsSync(path.join(root, "README.md")) ? ["README.md"] : [])
|
|
230
|
-
]);
|
|
231
|
-
const manifest = {
|
|
232
|
-
$schema: SCHEMA_ID,
|
|
233
|
-
format: FORMAT,
|
|
234
|
-
schema_version: SCHEMA_VERSION,
|
|
235
|
-
id: id || "",
|
|
236
|
-
aliases,
|
|
237
|
-
title: inner?.title || inner?.display_name || rootV1?.title || pkg?.name || pkg?.title || id || "",
|
|
238
|
-
scope: rootV1?.scope || (pkg ? "package" : inner?.graph_type === "skill" ? "skill" : "repository"),
|
|
239
|
-
kind: inner?.graph_type || inner?.kind || (pkg ? "graph_package" : rootV1?.scope || "repository_graph"),
|
|
240
|
-
owner: owner || "",
|
|
241
|
-
profiles,
|
|
242
|
-
graph: hasLocalGraph ? {
|
|
243
|
-
root: graphRoot,
|
|
244
|
-
source_of_truth: sourceOfTruth,
|
|
245
|
-
objects,
|
|
246
|
-
relations,
|
|
247
|
-
schemas,
|
|
248
|
-
generated,
|
|
249
|
-
raw_sources: rawSources
|
|
250
|
-
} : null,
|
|
251
|
-
imports: normalizeImports(rootV1?.imports)
|
|
252
|
-
};
|
|
253
|
-
for (const field of ["version", "conformance_level", "description", "license", "public_safety", "nonclaims"]) {
|
|
254
|
-
if (pkg?.[field] !== undefined) manifest[field] = pkg[field];
|
|
255
|
-
}
|
|
256
|
-
if (inner?.federation !== undefined) manifest.federation = inner.federation;
|
|
257
|
-
if (inner?.graph_runtime !== undefined) manifest.runtime = inner.graph_runtime;
|
|
258
|
-
else if (inner?.graphRuntime !== undefined) manifest.runtime = inner.graphRuntime;
|
|
259
|
-
if (inner?.evolution !== undefined) manifest.evolution = inner.evolution;
|
|
260
|
-
const extensions = {};
|
|
261
|
-
const legacyExtensions = {};
|
|
262
|
-
if (inner?.dna_path) legacyExtensions.dna_path = inner.dna_path;
|
|
263
|
-
if (inner?.graph_kernel) legacyExtensions.graph_kernel = inner.graph_kernel;
|
|
264
|
-
if (Object.keys(legacyExtensions).length) extensions["simai.legacy"] = legacyExtensions;
|
|
265
|
-
if (inner?.hybrid_sot !== undefined) extensions["simai.hybrid_sot"] = inner.hybrid_sot;
|
|
266
|
-
const inlineGraph = Object.fromEntries(["nodes", "edges"].filter((field) => inner?.[field] !== undefined).map((field) => [field, inner[field]]));
|
|
267
|
-
if (Object.keys(inlineGraph).length) extensions["simai.legacy.inline_graph"] = inlineGraph;
|
|
268
|
-
const skillManifest = Object.fromEntries(["display_name", "model", "skill"].filter((field) => inner?.[field] !== undefined).map((field) => [field, inner[field]]));
|
|
269
|
-
if (Object.keys(skillManifest).length) extensions["simai.legacy.skill_manifest"] = skillManifest;
|
|
270
|
-
const camelMetadata = Object.fromEntries([
|
|
271
|
-
...["status"].filter((field) => inner?.[field] !== undefined).map((field) => [field, inner[field]]),
|
|
272
|
-
...["legacyPackageId", "ownerSkill", "domainOwnerSkill", "hybridSot", "graphOnlyRuntimeAllowed", "createdAt", "status"].filter((field) => pkg?.[field] !== undefined).map((field) => [field, pkg[field]])
|
|
273
|
-
]);
|
|
274
|
-
if (Object.keys(camelMetadata).length) extensions["simai.legacy.camel_case_manifest"] = camelMetadata;
|
|
275
|
-
const packageExtensions = {};
|
|
276
|
-
if (pkg?.gates !== undefined) packageExtensions.gates = pkg.gates;
|
|
277
|
-
if (pkg?.results !== undefined) packageExtensions.results = pkg.results;
|
|
278
|
-
if (Object.keys(packageExtensions).length) extensions["mirai-graph.package"] = packageExtensions;
|
|
279
|
-
if (Object.keys(extensions).length) manifest.extensions = extensions;
|
|
280
|
-
for (const field of ["description", "public_safety"]) if (inner?.[field] !== undefined) manifest[field] = inner[field];
|
|
281
|
-
const operational = Object.fromEntries(["type", "canonical_projection", "management_profile", "runtime_context", "entrypoints", "ownerSkill", "domainOwnerSkills", "companionSkills"].filter((field) => inner?.[field] !== undefined).map((field) => [field, inner[field]]));
|
|
282
|
-
if (Object.keys(operational).length) {
|
|
283
|
-
manifest.extensions = { ...(manifest.extensions || {}), "simai.legacy.operational": operational };
|
|
284
|
-
}
|
|
285
|
-
conflicts.push(...validateManifest(manifest, root).filter((error) => !error.startsWith("missing graph.")));
|
|
286
|
-
const uniqueConflicts = sortedUnique(conflicts);
|
|
287
|
-
return {
|
|
288
|
-
status: uniqueConflicts.length ? "needs_input" : "success",
|
|
289
|
-
manifest_status: uniqueConflicts.some((item) => item.startsWith("manifest_identity_conflict")) ? "conflict" : known.length ? "legacy" : "missing",
|
|
290
|
-
source_formats: sources.map((item) => item.format),
|
|
291
|
-
target_schema_version: SCHEMA_VERSION,
|
|
292
|
-
migration_required: known.length > 0,
|
|
293
|
-
identity_map: { canonical: manifest.id || null, aliases },
|
|
294
|
-
conflicts: uniqueConflicts,
|
|
295
|
-
can_execute_now: uniqueConflicts.length === 0,
|
|
296
|
-
operation_mode: "read_only",
|
|
297
|
-
next_action: uniqueConflicts.length ? "resolve conflicts and rerun preview" : "rerun with --apply",
|
|
298
|
-
manifest,
|
|
299
|
-
source_hashes: Object.fromEntries(sources.map((item) => [item.relative, item.hash]))
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function applyMigration(repo, options = {}) {
|
|
304
|
-
const root = path.resolve(repo);
|
|
305
|
-
const graphDataBefore = graphDataFingerprint(root);
|
|
306
|
-
const plan = migratePlan(root, options);
|
|
307
|
-
if (!plan.migration_required) return { ...plan, operation_mode: "transactional", writes_performed: false };
|
|
308
|
-
if (!plan.can_execute_now) throw new Error(`migration blocked: ${plan.conflicts.join("; ")}`);
|
|
309
|
-
const candidateBytes = jsonBytes(plan.manifest);
|
|
310
|
-
const candidateErrors = validateManifest(plan.manifest, root).filter((error) => !error.startsWith("missing graph."));
|
|
311
|
-
if (candidateErrors.length) throw new Error(`candidate invalid: ${candidateErrors.join("; ")}`);
|
|
312
|
-
const migrationId = `${new Date().toISOString().replace(/[-:.TZ]/g, "").slice(0, 14)}-${sha256(candidateBytes).slice(7, 19)}`;
|
|
313
|
-
const stateDir = path.join(root, ".mirai-graph", "migrations", migrationId);
|
|
314
|
-
fs.mkdirSync(stateDir, { recursive: true });
|
|
315
|
-
for (const source of detectManifestSources(root)) {
|
|
316
|
-
const backup = path.join(stateDir, source.relative);
|
|
317
|
-
fs.mkdirSync(path.dirname(backup), { recursive: true });
|
|
318
|
-
fs.copyFileSync(source.absolute, backup);
|
|
319
|
-
}
|
|
320
|
-
fs.writeFileSync(path.join(stateDir, "plan.json"), jsonBytes({ source_hashes: plan.source_hashes, target_hash: sha256(candidateBytes), manifest: plan.manifest }));
|
|
321
|
-
const candidatePath = path.join(stateDir, "graph.json.candidate");
|
|
322
|
-
fs.writeFileSync(candidatePath, candidateBytes);
|
|
323
|
-
try {
|
|
324
|
-
fs.renameSync(candidatePath, path.join(root, "graph.json"));
|
|
325
|
-
for (const relative of ["graph/graph.json", "mirai-graph-package.json"]) {
|
|
326
|
-
const filePath = path.join(root, relative);
|
|
327
|
-
if (fs.existsSync(filePath)) fs.unlinkSync(filePath);
|
|
328
|
-
}
|
|
329
|
-
const verified = migratePlan(root, options);
|
|
330
|
-
if (!verified.can_execute_now || verified.manifest_status !== "current") {
|
|
331
|
-
throw new Error(`post-activation verification failed: ${verified.conflicts.join("; ")}`);
|
|
332
|
-
}
|
|
333
|
-
const graphDataAfter = graphDataFingerprint(root);
|
|
334
|
-
if (JSON.stringify(graphDataAfter) !== JSON.stringify(graphDataBefore)) throw new Error("graph data changed during manifest-only migration");
|
|
335
|
-
fs.writeFileSync(path.join(stateDir, "receipt.json"), jsonBytes({ status: "complete", migration_id: migrationId, target_hash: sha256(candidateBytes) }));
|
|
336
|
-
return { ...verified, operation_mode: "transactional", writes_performed: true, migration_id: migrationId, rollback_snapshot: stateDir, semantic_equivalence: { status: "success", before: graphDataBefore, after: graphDataAfter } };
|
|
337
|
-
} catch (error) {
|
|
338
|
-
for (const relative of MANIFEST_PATHS) {
|
|
339
|
-
const target = path.join(root, relative);
|
|
340
|
-
const backup = path.join(stateDir, relative);
|
|
341
|
-
if (fs.existsSync(backup)) {
|
|
342
|
-
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
343
|
-
fs.copyFileSync(backup, target);
|
|
344
|
-
} else if (fs.existsSync(target)) {
|
|
345
|
-
fs.unlinkSync(target);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
fs.writeFileSync(path.join(stateDir, "receipt.json"), jsonBytes({ status: "rolled_back", migration_id: migrationId, error: String(error.message || error) }));
|
|
349
|
-
throw new Error(`migration rolled back: ${error.message || error}`);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
module.exports = {
|
|
354
|
-
FORMAT,
|
|
355
|
-
LEGACY_WORKSPACE_SCHEMA,
|
|
356
|
-
MANIFEST_PATHS,
|
|
357
|
-
SCHEMA_ID,
|
|
358
|
-
SCHEMA_VERSION,
|
|
359
|
-
applyMigration,
|
|
360
|
-
graphDataFingerprint,
|
|
361
|
-
detectManifestSources,
|
|
362
|
-
jsonBytes,
|
|
363
|
-
migratePlan,
|
|
364
|
-
readJson,
|
|
365
|
-
sha256,
|
|
366
|
-
validateManifest
|
|
367
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
|
|
6
|
-
function readJson(filePath) {
|
|
7
|
-
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function list(items, emptyText) {
|
|
11
|
-
if (!items || items.length === 0) {
|
|
12
|
-
return `- ${emptyText}`;
|
|
13
|
-
}
|
|
14
|
-
return items.map((item) => `- ${item}`).join("\n");
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const packageDir = process.argv[2] || "examples/instrumentation-layer-minimal";
|
|
18
|
-
const resultsDir = path.join(packageDir, "results");
|
|
19
|
-
const cockpit = readJson(path.join(resultsDir, "development-cockpit.json"));
|
|
20
|
-
const traceability = readJson(path.join(resultsDir, "feature-implementation-traceability.json"));
|
|
21
|
-
const feedback = readJson(path.join(resultsDir, "multi-source-quality-feedback.json"));
|
|
22
|
-
|
|
23
|
-
const cockpitInstruments = cockpit.instruments.map(
|
|
24
|
-
(instrument) => `\`${instrument.id}\` ${instrument.family}: ${instrument.score}/${100} (${instrument.band})`
|
|
25
|
-
);
|
|
26
|
-
const mappings = traceability.implementation_mappings.map(
|
|
27
|
-
(mapping) => `\`${mapping.feature_ref}\` -> ${mapping.implementation_refs.length} implementation refs, ${mapping.test_refs.length} test refs, ${mapping.evidence_refs.length} evidence refs`
|
|
28
|
-
);
|
|
29
|
-
const findings = feedback.findings.map(
|
|
30
|
-
(finding) => `\`${finding.id}\` ${finding.classification}, severity ${finding.severity}, blocking ${finding.blocking ? "true" : "false"}, route ${finding.next_route}`
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const lines = [
|
|
34
|
-
"# Mirai Graph Instrumentation Report",
|
|
35
|
-
"",
|
|
36
|
-
`- Package: \`${packageDir}\``,
|
|
37
|
-
`- Cockpit: \`${cockpit.id}\``,
|
|
38
|
-
`- Traceability: \`${traceability.id}\``,
|
|
39
|
-
`- Multi-source feedback: \`${feedback.id}\``,
|
|
40
|
-
`- Transition verdict: \`${feedback.verdict}\``,
|
|
41
|
-
`- Next transition: \`${feedback.next_transition}\``,
|
|
42
|
-
"",
|
|
43
|
-
"## Control Pattern",
|
|
44
|
-
"",
|
|
45
|
-
"```text",
|
|
46
|
-
"feature intent -> implementation traceability -> cockpit signals -> multi-source feedback -> transition decision -> Kaizen route",
|
|
47
|
-
"```",
|
|
48
|
-
"",
|
|
49
|
-
"## Cockpit",
|
|
50
|
-
"",
|
|
51
|
-
`- Subject: \`${cockpit.subject_ref}\``,
|
|
52
|
-
`- Production readiness: \`${cockpit.readiness.production_readiness}\``,
|
|
53
|
-
`- Next action: \`${cockpit.next_best_action.action}\``,
|
|
54
|
-
`- Target cycle: \`${cockpit.next_best_action.target_cycle}\``,
|
|
55
|
-
"",
|
|
56
|
-
"### Instruments",
|
|
57
|
-
"",
|
|
58
|
-
list(cockpitInstruments, "No cockpit instruments declared."),
|
|
59
|
-
"",
|
|
60
|
-
"### Required Gates",
|
|
61
|
-
"",
|
|
62
|
-
list(cockpit.next_best_action.required_gates, "No required gates declared."),
|
|
63
|
-
"",
|
|
64
|
-
"## Traceability",
|
|
65
|
-
"",
|
|
66
|
-
`- Features: \`${traceability.coverage_summary.feature_count}\``,
|
|
67
|
-
`- Mapped features: \`${traceability.coverage_summary.mapped_feature_count}\``,
|
|
68
|
-
`- Evidence-backed mappings: \`${traceability.coverage_summary.evidence_backed_mapping_count}\``,
|
|
69
|
-
`- Accepted features: \`${traceability.coverage_summary.accepted_feature_count}\``,
|
|
70
|
-
"",
|
|
71
|
-
"### Mappings",
|
|
72
|
-
"",
|
|
73
|
-
list(mappings, "No mappings declared."),
|
|
74
|
-
"",
|
|
75
|
-
"## Multi-Source Feedback",
|
|
76
|
-
"",
|
|
77
|
-
`- Sources: \`${feedback.sources.length}\``,
|
|
78
|
-
`- Findings: \`${feedback.findings.length}\``,
|
|
79
|
-
`- Blocking findings: \`${feedback.blocking_findings.length}\``,
|
|
80
|
-
"",
|
|
81
|
-
"### Findings",
|
|
82
|
-
"",
|
|
83
|
-
list(findings, "No findings declared."),
|
|
84
|
-
"",
|
|
85
|
-
"### Kaizen Refs",
|
|
86
|
-
"",
|
|
87
|
-
list(feedback.kaizen_refs, "No Kaizen refs declared."),
|
|
88
|
-
"",
|
|
89
|
-
"## Boundary",
|
|
90
|
-
"",
|
|
91
|
-
"- Cockpit scores are not acceptance.",
|
|
92
|
-
"- Feature mappings are not implementation by themselves.",
|
|
93
|
-
"- Tests and evidence do not authorize canonical updates.",
|
|
94
|
-
"- Multi-source feedback calibrates transition decisions; blocking findings stop the transitions they block."
|
|
95
|
-
];
|
|
96
|
-
|
|
97
|
-
console.log(lines.join("\n"));
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const path = require("path");
|
|
4
|
-
const { applyMigration, migratePlan } = require("./graph-manifest");
|
|
5
|
-
|
|
6
|
-
function usage() {
|
|
7
|
-
console.error("Usage: mirai-graph migrate [target-dir] [--owner <owner>] [--apply]");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function main() {
|
|
11
|
-
const args = process.argv.slice(2);
|
|
12
|
-
let target = process.cwd();
|
|
13
|
-
let owner;
|
|
14
|
-
let apply = false;
|
|
15
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
16
|
-
const arg = args[index];
|
|
17
|
-
if (arg === "--apply") { apply = true; continue; }
|
|
18
|
-
if (arg === "--owner") {
|
|
19
|
-
owner = args[index + 1];
|
|
20
|
-
if (!owner) throw new Error("--owner requires a value");
|
|
21
|
-
index += 1;
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
if (arg.startsWith("--")) { usage(); throw new Error(`unknown option ${arg}`); }
|
|
25
|
-
target = path.resolve(arg);
|
|
26
|
-
}
|
|
27
|
-
const result = apply ? applyMigration(target, { owner }) : migratePlan(target, { owner });
|
|
28
|
-
console.log(JSON.stringify(result, null, 2));
|
|
29
|
-
if (result.manifest_status === "conflict" || result.status === "fail") process.exitCode = 2;
|
|
30
|
-
else if (!result.can_execute_now && result.manifest_status !== "missing") process.exitCode = 3;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
try { main(); } catch (error) { console.error(error.message); process.exit(1); }
|
|
@@ -1,154 +0,0 @@
|
|
|
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
|
-
|
|
9
|
-
function usage() {
|
|
10
|
-
console.error("Usage:");
|
|
11
|
-
console.error(" mirai-graph validate <package-dir>");
|
|
12
|
-
console.error(" mirai-graph init [target-dir] --profile <profile> [--template <template>] [--force]");
|
|
13
|
-
console.error(" mirai-graph migrate [target-dir] [--owner <owner>] [--apply]");
|
|
14
|
-
console.error(" mirai-graph detect [target-dir] [--json|--markdown]");
|
|
15
|
-
console.error(" mirai-graph bootstrap [target-dir] --mode detect|suggest [--profile auto|<profile>] [--output <dir>] [--json|--markdown]");
|
|
16
|
-
console.error(" mirai-graph choose-profile");
|
|
17
|
-
console.error(" mirai-graph adopter plan <role-or-profile>");
|
|
18
|
-
console.error(" mirai-graph adopter report <template-dir>");
|
|
19
|
-
console.error(" mirai-graph report validation <package-dir>");
|
|
20
|
-
console.error(" mirai-graph report process-transition <state-machine-file> <transition-request-file>");
|
|
21
|
-
console.error(" mirai-graph report technology-quality-feedback <feedback-file>");
|
|
22
|
-
console.error(" mirai-graph report dynamic-episode <trace-file>");
|
|
23
|
-
console.error(" mirai-graph report instrumentation [package-dir]");
|
|
24
|
-
console.error(" mirai-graph explain process-transition <state-machine-file> <transition-request-file>");
|
|
25
|
-
console.error(" mirai-graph report playground");
|
|
26
|
-
console.error(" mirai-graph release state [--markdown] [--require-git-tag] [--require-github-release] [--require-npm-published]");
|
|
27
|
-
console.error(" mirai-graph technology <explain|status|plan|verify|context> [repository] [options]");
|
|
28
|
-
console.error(" mirai-graph technology <enable|sync|connect|disconnect|provide|disable|repair|artifact> [repository] [options] [--apply]");
|
|
29
|
-
console.error("");
|
|
30
|
-
console.error("Boundary:");
|
|
31
|
-
console.error(" Reports explain validation decisions. They do not authorize canonical updates.");
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function run(script, args, cwd = root) {
|
|
35
|
-
const result = spawnSync(node, [path.join(root, script), ...args], {
|
|
36
|
-
cwd,
|
|
37
|
-
stdio: "inherit"
|
|
38
|
-
});
|
|
39
|
-
process.exit(result.status === null ? 1 : result.status);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const args = process.argv.slice(2);
|
|
43
|
-
|
|
44
|
-
if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
|
|
45
|
-
usage();
|
|
46
|
-
process.exit(args.length === 0 ? 1 : 0);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const [command, subcommand, ...rest] = args;
|
|
50
|
-
|
|
51
|
-
if (command === "technology") {
|
|
52
|
-
if (!subcommand) {
|
|
53
|
-
usage();
|
|
54
|
-
process.exit(1);
|
|
55
|
-
}
|
|
56
|
-
run("packages/cli/project-technology.js", [subcommand, ...rest], process.cwd());
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (command === "init" || command === "detect" || command === "bootstrap") {
|
|
60
|
-
const forwarded = subcommand ? [subcommand, ...rest] : rest;
|
|
61
|
-
run("packages/cli/self-service-onboarding.js", [command, ...forwarded]);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (command === "validate") {
|
|
65
|
-
if (!subcommand) {
|
|
66
|
-
usage();
|
|
67
|
-
process.exit(1);
|
|
68
|
-
}
|
|
69
|
-
run("packages/cli/validate-mirai-graph.js", [subcommand, ...rest]);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (command === "migrate") {
|
|
73
|
-
const forwarded = subcommand ? [subcommand, ...rest] : rest;
|
|
74
|
-
run("packages/cli/migrate-graph-manifest.js", forwarded);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (command === "choose-profile") {
|
|
78
|
-
if (subcommand || rest.length !== 0) {
|
|
79
|
-
usage();
|
|
80
|
-
process.exit(1);
|
|
81
|
-
}
|
|
82
|
-
run("packages/cli/adopter-workflow.js", ["choose-profile"]);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (command === "adopter" && subcommand === "plan") {
|
|
86
|
-
if (rest.length !== 1) {
|
|
87
|
-
usage();
|
|
88
|
-
process.exit(1);
|
|
89
|
-
}
|
|
90
|
-
run("packages/cli/adopter-workflow.js", ["plan", rest[0]]);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (command === "adopter" && subcommand === "report") {
|
|
94
|
-
if (rest.length !== 1) {
|
|
95
|
-
usage();
|
|
96
|
-
process.exit(1);
|
|
97
|
-
}
|
|
98
|
-
run("packages/cli/adopter-workflow.js", ["report", rest[0]]);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (command === "report" && subcommand === "validation") {
|
|
102
|
-
if (rest.length !== 1) {
|
|
103
|
-
usage();
|
|
104
|
-
process.exit(1);
|
|
105
|
-
}
|
|
106
|
-
run("packages/cli/validate-mirai-graph.js", ["--markdown", rest[0]]);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if ((command === "report" || command === "explain") && subcommand === "process-transition") {
|
|
110
|
-
if (rest.length !== 2) {
|
|
111
|
-
usage();
|
|
112
|
-
process.exit(1);
|
|
113
|
-
}
|
|
114
|
-
run("packages/cli/validate-mirai-graph.js", ["--markdown", "process-transition", rest[0], rest[1]]);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (command === "report" && subcommand === "technology-quality-feedback") {
|
|
118
|
-
if (rest.length !== 1) {
|
|
119
|
-
usage();
|
|
120
|
-
process.exit(1);
|
|
121
|
-
}
|
|
122
|
-
run("packages/cli/validate-mirai-graph.js", ["--markdown", "technology-quality-feedback", rest[0]]);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (command === "report" && subcommand === "dynamic-episode") {
|
|
126
|
-
if (rest.length !== 1) {
|
|
127
|
-
usage();
|
|
128
|
-
process.exit(1);
|
|
129
|
-
}
|
|
130
|
-
run("packages/cli/validate-mirai-graph.js", ["--markdown", "dynamic-episode-trace", rest[0]]);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (command === "report" && subcommand === "instrumentation") {
|
|
134
|
-
if (rest.length > 1) {
|
|
135
|
-
usage();
|
|
136
|
-
process.exit(1);
|
|
137
|
-
}
|
|
138
|
-
run("packages/cli/instrumentation-report.js", rest);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (command === "report" && subcommand === "playground") {
|
|
142
|
-
if (rest.length !== 0) {
|
|
143
|
-
usage();
|
|
144
|
-
process.exit(1);
|
|
145
|
-
}
|
|
146
|
-
run("packages/cli/playground-demo.js", []);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (command === "release" && subcommand === "state") {
|
|
150
|
-
run("packages/cli/release-state.js", rest);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
usage();
|
|
154
|
-
process.exit(1);
|