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,105 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const { spawnSync } = require("child_process");
|
|
5
|
-
|
|
6
|
-
const stateMachine = "examples/process-transition-minimal/state-machine.json";
|
|
7
|
-
const fixtures = [
|
|
8
|
-
"examples/process-transition-minimal/results/transition-explanation-valid.json",
|
|
9
|
-
"examples/process-transition-minimal/results/transition-explanation-invalid-ready-to-written.json"
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
function readJson(filePath) {
|
|
13
|
-
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function runValidator(args) {
|
|
17
|
-
return spawnSync(process.execPath, ["packages/cli/validate-mirai-graph.js", ...args], {
|
|
18
|
-
encoding: "utf8"
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function sortJson(value) {
|
|
23
|
-
if (Array.isArray(value)) {
|
|
24
|
-
return value.map(sortJson);
|
|
25
|
-
}
|
|
26
|
-
if (value && typeof value === "object") {
|
|
27
|
-
return Object.fromEntries(
|
|
28
|
-
Object.keys(value).sort().map((key) => [key, sortJson(value[key])])
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
return value;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function stable(value) {
|
|
35
|
-
return JSON.stringify(sortJson(value));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const errors = [];
|
|
39
|
-
|
|
40
|
-
for (const fixturePath of fixtures) {
|
|
41
|
-
const fixture = readJson(fixturePath);
|
|
42
|
-
const run = runValidator(["process-transition", stateMachine, fixture.request_ref]);
|
|
43
|
-
let output;
|
|
44
|
-
try {
|
|
45
|
-
output = JSON.parse(run.stdout);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
errors.push(`${fixturePath}: validator did not emit parseable JSON`);
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (output.valid !== fixture.expected_valid) {
|
|
52
|
-
errors.push(`${fixturePath}: expected valid=${fixture.expected_valid}, got ${output.valid}`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (fixture.expected_valid && run.status !== 0) {
|
|
56
|
-
errors.push(`${fixturePath}: expected validator exit 0, got ${run.status}`);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (!fixture.expected_valid && run.status === 0) {
|
|
60
|
-
errors.push(`${fixturePath}: expected validator to fail`);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (!output.explanation || typeof output.explanation !== "object") {
|
|
64
|
-
errors.push(`${fixturePath}: missing explanation object`);
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (stable(output.explanation) !== stable(fixture.explanation)) {
|
|
69
|
-
errors.push(`${fixturePath}: explanation does not match committed fixture`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (fixture.expected_error && !output.errors.includes(fixture.expected_error)) {
|
|
73
|
-
errors.push(`${fixturePath}: expected error not found`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const markdown = runValidator([
|
|
78
|
-
"--markdown",
|
|
79
|
-
"process-transition",
|
|
80
|
-
stateMachine,
|
|
81
|
-
"examples/process-transition-minimal/transition-request.json"
|
|
82
|
-
]);
|
|
83
|
-
if (markdown.status !== 0) {
|
|
84
|
-
errors.push(`markdown report failed with exit ${markdown.status}`);
|
|
85
|
-
}
|
|
86
|
-
for (const requiredText of [
|
|
87
|
-
"Process Transition Decision Report",
|
|
88
|
-
"Transition: `release_ready -> released`",
|
|
89
|
-
"Kaizen decision: `satisfied`",
|
|
90
|
-
"Missing Evidence"
|
|
91
|
-
]) {
|
|
92
|
-
if (!markdown.stdout.includes(requiredText)) {
|
|
93
|
-
errors.push(`markdown report missing ${requiredText}`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const output = {
|
|
98
|
-
mode: "process_transition_report",
|
|
99
|
-
valid: errors.length === 0,
|
|
100
|
-
checked_files: fixtures,
|
|
101
|
-
errors
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
console.log(JSON.stringify(output, null, 2));
|
|
105
|
-
process.exit(output.valid ? 0 : 1);
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
|
|
5
|
-
const resultFiles = [
|
|
6
|
-
"examples/minimal-graph/results/profile-conformance-result.json",
|
|
7
|
-
"examples/ai-employee-minimal/results/profile-conformance-result.json",
|
|
8
|
-
"examples/skill-runtime-minimal/results/profile-conformance-result.json",
|
|
9
|
-
"examples/organization-governance-minimal/results/profile-conformance-result.json",
|
|
10
|
-
"benchmarks/synthetic-context-reduction-v0/results/profile-conformance-result.json",
|
|
11
|
-
"pilots/independent-implementation-001-conference-planning/results/profile-conformance-result.json",
|
|
12
|
-
"pilots/independent-implementation-002-software-specification/results/profile-conformance-result.json",
|
|
13
|
-
"pilots/independent-implementation-003-ai-employee-workflow/results/profile-conformance-result.json",
|
|
14
|
-
"pilots/independent-implementation-004-research-program/results/profile-conformance-result.json",
|
|
15
|
-
"pilots/independent-implementation-005-organization-governance/results/profile-conformance-result.json"
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
const errors = [];
|
|
19
|
-
|
|
20
|
-
for (const file of resultFiles) {
|
|
21
|
-
let result;
|
|
22
|
-
try {
|
|
23
|
-
result = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
24
|
-
} catch (error) {
|
|
25
|
-
errors.push(`${file}: cannot read JSON: ${error.message}`);
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (result.valid !== true) {
|
|
30
|
-
errors.push(`${file}: valid must be true`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (!Array.isArray(result.errors) || result.errors.length !== 0) {
|
|
34
|
-
errors.push(`${file}: errors must be an empty array`);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (typeof result.profile !== "string" || result.profile.trim() === "") {
|
|
38
|
-
errors.push(`${file}: profile must be a non-empty string`);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
typeof result.command !== "string" ||
|
|
43
|
-
!result.command.includes("validate-mirai-graph.js")
|
|
44
|
-
) {
|
|
45
|
-
errors.push(`${file}: command must reference validate-mirai-graph.js`);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
typeof result.claim_supported !== "string" ||
|
|
50
|
-
!result.claim_supported.includes("declared Mirai Graph profile shape")
|
|
51
|
-
) {
|
|
52
|
-
errors.push(`${file}: claim_supported must stay limited to profile shape conformance`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const output = {
|
|
57
|
-
mode: "profile_conformance_results",
|
|
58
|
-
valid: errors.length === 0,
|
|
59
|
-
checked_files: resultFiles,
|
|
60
|
-
errors
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
console.log(JSON.stringify(output, null, 2));
|
|
64
|
-
process.exit(output.valid ? 0 : 1);
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const assert = require("assert");
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
const os = require("os");
|
|
8
|
-
const path = require("path");
|
|
9
|
-
const { spawnSync } = require("child_process");
|
|
10
|
-
const technology = require("../project-technology");
|
|
11
|
-
|
|
12
|
-
function writeJson(file, value) {
|
|
13
|
-
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
14
|
-
fs.writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function git(repo, ...args) {
|
|
18
|
-
const run = spawnSync("git", args, { cwd: repo, encoding: "utf8" });
|
|
19
|
-
if (run.status !== 0) throw new Error(run.stderr || `git ${args.join(" ")} failed`);
|
|
20
|
-
return run.stdout.trim();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function manifest(id) {
|
|
24
|
-
return {
|
|
25
|
-
$schema: "https://mirai-graph.dev/schemas/graph-manifest.schema.json",
|
|
26
|
-
format: "mirai-graph", schema_version: "2.0.0", id, aliases: [], title: id,
|
|
27
|
-
scope: "repository", kind: "repository_graph", owner: "fixture-owner",
|
|
28
|
-
profiles: ["project_management", "implementation_control"],
|
|
29
|
-
graph: {
|
|
30
|
-
root: "graph", source_of_truth: ["graph/specs"], objects: ["graph/specs/objects.json"],
|
|
31
|
-
relations: ["graph/specs/relations.json"], schemas: [], generated: ["graph/generated"], raw_sources: ["README.md"],
|
|
32
|
-
},
|
|
33
|
-
imports: [],
|
|
34
|
-
extensions: { "mirai.project_technology": technology.extensionContract() },
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function createRepo(root, name, withGit = true) {
|
|
39
|
-
const repo = path.join(root, name); fs.mkdirSync(repo, { recursive: true });
|
|
40
|
-
writeJson(path.join(repo, "graph.json"), manifest(name));
|
|
41
|
-
writeJson(path.join(repo, "graph/specs/objects.json"), [{
|
|
42
|
-
id: "goal.fixture.delivery", kind: "goal", title: "Deliver fixture", summary: "Complete a safe fixture task",
|
|
43
|
-
readiness: "accepted", profile: "project_management", source_refs: ["README.md"],
|
|
44
|
-
}]);
|
|
45
|
-
writeJson(path.join(repo, "graph/specs/relations.json"), []);
|
|
46
|
-
fs.writeFileSync(path.join(repo, "README.md"), "# Fixture\nPortable safe context.\n");
|
|
47
|
-
if (withGit) {
|
|
48
|
-
git(repo, "init", "-q"); git(repo, "config", "user.name", "Mirai Fixture"); git(repo, "config", "user.email", "fixture@example.invalid");
|
|
49
|
-
git(repo, "add", "."); git(repo, "commit", "-qm", "initial graph");
|
|
50
|
-
}
|
|
51
|
-
return repo;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function evidence(task, options = {}) {
|
|
55
|
-
return {
|
|
56
|
-
task_digest: technology.sha256(task, true),
|
|
57
|
-
outcome: options.outcome || `Verified result for ${task}`,
|
|
58
|
-
requirement_refs: options.requirement_refs || ["requirement.fixture.portability"],
|
|
59
|
-
evidence_refs: ["repo://fixture/checks/continuity"],
|
|
60
|
-
checks: [{ id: "check.fixture.continuity", verdict: "pass", evidence_ref: "repo://fixture/checks/continuity" }],
|
|
61
|
-
changed_surfaces: ["src/fixture.js"],
|
|
62
|
-
case_signature: options.case_signature || "case.fixture.portable-work",
|
|
63
|
-
method_candidate: options.method_candidate || null,
|
|
64
|
-
decisions: options.decisions || [],
|
|
65
|
-
source_revision: options.source_revision || null,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const checks = [];
|
|
70
|
-
function check(id, condition, details = null) {
|
|
71
|
-
checks.push({ id, passed: Boolean(condition), details });
|
|
72
|
-
assert.ok(condition, `${id}: ${JSON.stringify(details)}`);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "mirai-continuity-"));
|
|
76
|
-
const stateRoot = path.join(root, "host-state");
|
|
77
|
-
try {
|
|
78
|
-
const repo = createRepo(root, "git-project");
|
|
79
|
-
const before = git(repo, "status", "--porcelain=v1");
|
|
80
|
-
const taskStart = technology.execute("sync", repo, { apply: true, boundary: "task_start", stateRoot });
|
|
81
|
-
check("task_start_is_read_only", taskStart.status === "success" && taskStart.changed === false && git(repo, "status", "--porcelain=v1") === before, taskStart);
|
|
82
|
-
const preview = technology.execute("sync", repo, { apply: false, boundary: "task_complete", continuityEvidence: evidence("preview"), stateRoot });
|
|
83
|
-
check("preview_is_zero_write", preview.status === "preview" && git(repo, "status", "--porcelain=v1") === before, preview);
|
|
84
|
-
const missingReceiptVerify = technology.verify(repo, { stateRoot });
|
|
85
|
-
check("configured_continuity_without_receipt_blocks_verify", missingReceiptVerify.status === "blocked" && missingReceiptVerify.blockers.includes("continuity_missing"), missingReceiptVerify);
|
|
86
|
-
|
|
87
|
-
const first = technology.execute("sync", repo, { apply: true, boundary: "stage_complete", continuityEvidence: evidence("first", { method_candidate: "Use the verified bounded fixture path." }), stateRoot });
|
|
88
|
-
check("verified_result_is_saved", first.status === "success" && first.changed && first.continuity.saved_refs.length === 2, first);
|
|
89
|
-
check("portable_authority_is_graph_specs", fs.existsSync(path.join(repo, "graph/specs/project-continuity.json")) && first.continuity.authority === "graph/specs");
|
|
90
|
-
check("host_state_is_outside_project", !fs.existsSync(path.join(repo, ".mirai-graph/project-technology/receipts")) && fs.existsSync(stateRoot));
|
|
91
|
-
check("human_projection_is_generated", fs.readFileSync(path.join(repo, "graph/docs/project-context.md"), "utf8").includes("not a source of truth"));
|
|
92
|
-
const objectsAfterFirst = JSON.parse(fs.readFileSync(path.join(repo, "graph/specs/project-continuity.json"), "utf8")).objects;
|
|
93
|
-
check("first_method_is_proposal", objectsAfterFirst.some((item) => item.kind === "lesson" && item.readiness === "proposal"));
|
|
94
|
-
check("architecture_decision_is_not_accepted", technology.execute("sync", repo, {
|
|
95
|
-
apply: true, boundary: "task_complete", stateRoot,
|
|
96
|
-
continuityEvidence: evidence("decision", { decisions: [{ summary: "Replace the project architecture", changes_architecture: true }] }),
|
|
97
|
-
}).status === "success");
|
|
98
|
-
const decisionObjects = JSON.parse(fs.readFileSync(path.join(repo, "graph/specs/project-continuity.json"), "utf8")).objects;
|
|
99
|
-
check("architecture_change_remains_proposal", decisionObjects.some((item) => item.kind === "decision" && item.summary === "Replace the project architecture" && item.readiness === "proposal"));
|
|
100
|
-
|
|
101
|
-
const second = technology.execute("sync", repo, { apply: true, boundary: "task_complete", continuityEvidence: evidence("second", { method_candidate: "Use the verified bounded fixture path." }), stateRoot });
|
|
102
|
-
check("second_independent_case_is_saved", second.status === "success", second);
|
|
103
|
-
const objectsAfterSecond = JSON.parse(fs.readFileSync(path.join(repo, "graph/specs/project-continuity.json"), "utf8")).objects;
|
|
104
|
-
check("method_promotes_after_two_independent_cases", objectsAfterSecond.some((item) => item.kind === "lesson" && item.readiness === "accepted" && item.supporting_case_ids.length >= 2));
|
|
105
|
-
|
|
106
|
-
const beforeRepeat = fs.readFileSync(path.join(repo, "graph/specs/project-continuity.json"));
|
|
107
|
-
const repeated = technology.execute("sync", repo, { apply: true, boundary: "task_complete", continuityEvidence: evidence("second", { method_candidate: "Use the verified bounded fixture path." }), stateRoot });
|
|
108
|
-
check("repeat_is_byte_identical", repeated.status === "success" && repeated.changed === false && fs.readFileSync(path.join(repo, "graph/specs/project-continuity.json")).equals(beforeRepeat), repeated);
|
|
109
|
-
check("fresh_continuity_verifies_without_target_for_light_work", technology.verify(repo, { stateRoot }).status === "success");
|
|
110
|
-
check("fresh_receipt_allows_significant_work", technology.continuity.verify(repo, JSON.parse(fs.readFileSync(path.join(repo, "graph.json"), "utf8")), { stateRoot }).status === "success");
|
|
111
|
-
|
|
112
|
-
const staleDigest = technology.continuity.graphDigest(repo);
|
|
113
|
-
fs.appendFileSync(path.join(repo, "graph/specs/objects.json"), " ");
|
|
114
|
-
check("stale_continuity_blocks_significant_work", technology.continuity.verify(repo, JSON.parse(fs.readFileSync(path.join(repo, "graph.json"), "utf8")), { stateRoot }).blockers.includes("continuity_stale"));
|
|
115
|
-
const baseObjects = JSON.parse(fs.readFileSync(path.join(repo, "graph/specs/objects.json"), "utf8"));
|
|
116
|
-
baseObjects[0].summary = "Changed concurrently";
|
|
117
|
-
fs.writeFileSync(path.join(repo, "graph/specs/objects.json"), JSON.stringify(baseObjects, null, 2) + "\n");
|
|
118
|
-
const cas = technology.execute("sync", repo, { apply: true, boundary: "task_complete", continuityEvidence: evidence("cas"), expectedGraphDigest: staleDigest, stateRoot });
|
|
119
|
-
check("compare_and_swap_conflict_is_safe", cas.status === "blocked" && cas.blockers.includes("continuity_compare_and_swap_conflict"), cas);
|
|
120
|
-
baseObjects[0].summary = "Complete a safe fixture task";
|
|
121
|
-
fs.writeFileSync(path.join(repo, "graph/specs/objects.json"), JSON.stringify(baseObjects, null, 2) + "\n");
|
|
122
|
-
|
|
123
|
-
const secret = technology.execute("sync", repo, { apply: true, boundary: "task_complete", continuityEvidence: evidence("secret", { outcome: "token=not-a-real-secret-value-123456" }), stateRoot });
|
|
124
|
-
check("secret_is_rejected", secret.status === "blocked" && secret.blockers.includes("continuity_sensitive_or_host_data_forbidden"), secret);
|
|
125
|
-
const privatePath = technology.execute("sync", repo, { apply: true, boundary: "task_complete", continuityEvidence: { ...evidence("private"), changed_surfaces: ["source/memory/private.md"] }, stateRoot });
|
|
126
|
-
check("private_projection_is_rejected", privatePath.status === "blocked" && privatePath.blockers.includes("continuity_sensitive_or_host_data_forbidden"), privatePath);
|
|
127
|
-
const failedCheck = technology.execute("sync", repo, { apply: true, boundary: "task_complete", continuityEvidence: { ...evidence("fail"), checks: [{ id: "check.fixture", verdict: "fail", evidence_ref: "repo://fixture/fail" }] }, stateRoot });
|
|
128
|
-
check("unverified_result_is_rejected", failedCheck.status === "blocked" && failedCheck.blockers.includes("continuity_result_not_verified"), failedCheck);
|
|
129
|
-
|
|
130
|
-
git(repo, "add", "graph.json", "graph/specs", "graph/docs"); git(repo, "commit", "-qm", "portable continuity records");
|
|
131
|
-
const discovered = technology.context(repo, { phase: "discover", task: "use the verified portable work case" });
|
|
132
|
-
check("new_task_discovers_past_case", discovered.status === "success" && discovered.traversal_receipt.candidates.some((item) => item.id.startsWith("regression_case.continuity.")), discovered.blockers);
|
|
133
|
-
const beforeReadOnly = git(repo, "status", "--porcelain=v1");
|
|
134
|
-
technology.status(repo); technology.context(repo, { phase: "discover", task: "read only project context" });
|
|
135
|
-
check("read_only_operations_write_nothing", git(repo, "status", "--porcelain=v1") === beforeReadOnly);
|
|
136
|
-
|
|
137
|
-
const folder = createRepo(root, "shared-folder", false);
|
|
138
|
-
const folderFirst = technology.execute("sync", folder, { apply: true, boundary: "task_complete", continuityEvidence: evidence("folder"), stateRoot });
|
|
139
|
-
check("non_git_folder_supports_continuity", folderFirst.status === "success" && folderFirst.changed, folderFirst);
|
|
140
|
-
const folderRepeat = technology.execute("sync", folder, { apply: true, boundary: "task_complete", continuityEvidence: evidence("folder"), stateRoot });
|
|
141
|
-
check("non_git_repeat_is_idempotent", folderRepeat.status === "success" && folderRepeat.changed === false, folderRepeat);
|
|
142
|
-
const sharedLease = path.join(folder, "graph/.project-technology-continuity.lock");
|
|
143
|
-
fs.writeFileSync(sharedLease, "occupied\n");
|
|
144
|
-
const leaseConflict = technology.execute("sync", folder, { apply: true, boundary: "task_complete", continuityEvidence: evidence("parallel"), stateRoot: path.join(root, "third-installation-state") });
|
|
145
|
-
check("shared_folder_lease_blocks_parallel_writer", leaseConflict.status === "blocked" && leaseConflict.blockers.includes("continuity_lease_conflict"), leaseConflict);
|
|
146
|
-
fs.unlinkSync(sharedLease);
|
|
147
|
-
const folderDiscovery = technology.context(folder, { phase: "discover", task: "portable fixture case" });
|
|
148
|
-
check("non_git_context_is_available", folderDiscovery.status === "success", folderDiscovery.blockers);
|
|
149
|
-
check("same_content_has_stable_digest", technology.continuity.graphDigest(folder) === technology.continuity.graphDigest(folder));
|
|
150
|
-
|
|
151
|
-
const otherStateRoot = path.join(root, "other-installation-state");
|
|
152
|
-
const firstInstallContext = technology.context(repo, { phase: "discover", task: "use verified portable work" });
|
|
153
|
-
const secondInstallContext = technology.context(repo, { phase: "discover", task: "use verified portable work", stateRoot: otherStateRoot });
|
|
154
|
-
check("two_installations_get_same_context", firstInstallContext.traversal_receipt.traversal_digest === secondInstallContext.traversal_receipt.traversal_digest);
|
|
155
|
-
check("portable_specs_contain_no_host_paths", !/(?:\/Users\/|\/home\/|[A-Za-z]:\\Users\\)/.test(fs.readFileSync(path.join(repo, "graph/specs/project-continuity.json"), "utf8")));
|
|
156
|
-
check("continuity_policy_keeps_contract_version", JSON.parse(fs.readFileSync(path.join(repo, "graph.json"), "utf8")).extensions["mirai.project_technology"].contract_version === "1.0.0");
|
|
157
|
-
|
|
158
|
-
const bootstrapRepo = path.join(root, "existing-code-new-graph");
|
|
159
|
-
fs.mkdirSync(bootstrapRepo, { recursive: true });
|
|
160
|
-
fs.writeFileSync(path.join(bootstrapRepo, "README.md"), "# Existing code\n");
|
|
161
|
-
git(bootstrapRepo, "init", "-q"); git(bootstrapRepo, "config", "user.name", "Mirai Fixture"); git(bootstrapRepo, "config", "user.email", "fixture@example.invalid");
|
|
162
|
-
git(bootstrapRepo, "add", "README.md"); git(bootstrapRepo, "commit", "-qm", "existing code");
|
|
163
|
-
writeJson(path.join(bootstrapRepo, "graph.json"), manifest("bootstrap-project"));
|
|
164
|
-
writeJson(path.join(bootstrapRepo, "graph/specs/objects.json"), [{ id: "goal.bootstrap", kind: "goal", title: "Bootstrap", summary: "Use content-bound bootstrap context", readiness: "accepted", profile: "project_management" }]);
|
|
165
|
-
writeJson(path.join(bootstrapRepo, "graph/specs/relations.json"), []);
|
|
166
|
-
const bootstrapContext = technology.context(bootstrapRepo, { phase: "discover", task: "bootstrap context" });
|
|
167
|
-
check("new_git_graph_is_content_bound_before_first_commit", bootstrapContext.status === "success" && String(bootstrapContext.traversal_receipt.graph.revision).startsWith("content:"), bootstrapContext.blockers);
|
|
168
|
-
|
|
169
|
-
process.stdout.write(`${JSON.stringify({ status: "success", checks_passed: checks.length, checks_failed: 0, checks }, null, 2)}\n`);
|
|
170
|
-
} catch (error) {
|
|
171
|
-
process.stdout.write(`${JSON.stringify({ status: "fail", checks_passed: checks.filter((item) => item.passed).length, checks_failed: 1, checks, error: error.message }, null, 2)}\n`);
|
|
172
|
-
process.exitCode = 1;
|
|
173
|
-
}
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const assert = require("assert");
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
const os = require("os");
|
|
8
|
-
const path = require("path");
|
|
9
|
-
const { spawnSync } = require("child_process");
|
|
10
|
-
const technology = require("../project-technology");
|
|
11
|
-
|
|
12
|
-
const TARGET_ID = "fixture.target.accepted_v1";
|
|
13
|
-
const SEMANTIC_DIGEST = `sha256:${"2".repeat(64)}`;
|
|
14
|
-
|
|
15
|
-
function git(repo, ...args) {
|
|
16
|
-
const result = spawnSync("git", args, { cwd: repo, encoding: "utf8" });
|
|
17
|
-
if (result.status !== 0) throw new Error(result.stderr || `git ${args.join(" ")} failed`);
|
|
18
|
-
return result.stdout.trim();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function writeJson(file, value) {
|
|
22
|
-
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
23
|
-
fs.writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function manifest(id, scope = "repository", profiles = ["project_management", "implementation_control"]) {
|
|
27
|
-
return {
|
|
28
|
-
$schema: "https://mirai-graph.dev/schemas/graph-manifest.schema.json",
|
|
29
|
-
format: "mirai-graph", schema_version: "2.0.0", id, aliases: [],
|
|
30
|
-
title: id, scope, kind: `${scope}_graph`, owner: "fixture-owner", profiles,
|
|
31
|
-
graph: {
|
|
32
|
-
root: "graph", source_of_truth: ["graph/specs"], objects: ["graph/specs/index.json"],
|
|
33
|
-
relations: ["graph/specs/relations.json"], schemas: [],
|
|
34
|
-
generated: ["graph/generated"], raw_sources: ["README.md"],
|
|
35
|
-
},
|
|
36
|
-
imports: [],
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function executionContract() {
|
|
41
|
-
return {
|
|
42
|
-
decision_refs: ["decision.fixture.accepted"],
|
|
43
|
-
goal_binding: { goal_id: "goal.fixture.delivery", done_when_ids: ["done_when.fixture.ready"] },
|
|
44
|
-
requirement_bindings: [{
|
|
45
|
-
requirement_id: "requirement.fixture.runtime",
|
|
46
|
-
acceptance_ids: ["acceptance.fixture.runtime"],
|
|
47
|
-
done_when_ids: ["done_when.fixture.ready"],
|
|
48
|
-
}],
|
|
49
|
-
constraint_ids: ["constraint.fixture.single_owner"],
|
|
50
|
-
non_goal_ids: ["non_goal.fixture.parallel_runtime"],
|
|
51
|
-
deferred_boundary_ids: ["deferred.fixture.publication"],
|
|
52
|
-
allowed_change_scope: [{
|
|
53
|
-
repository_id: "fixture-consumer", owner_id: "runtime", package_id: "fixture/runtime",
|
|
54
|
-
file_patterns: ["packages/runtime/**"], actions: ["modify", "test"],
|
|
55
|
-
}, {
|
|
56
|
-
repository_id: "fixture-consumer-two", owner_id: "runtime", package_id: "fixture/runtime",
|
|
57
|
-
file_patterns: ["packages/runtime/**"], actions: ["modify", "test"],
|
|
58
|
-
}],
|
|
59
|
-
architecture_contract: {
|
|
60
|
-
contract_ref: "contract.fixture.architecture",
|
|
61
|
-
acceptance_ref: "decision.fixture.accepted", architecture_owner_id: "human.fixture.owner", lifecycle: "accepted",
|
|
62
|
-
owner_ids: ["runtime"], component_ids: ["component.fixture.runtime"],
|
|
63
|
-
package_ids: ["fixture/runtime"], capability_ids: ["capability.fixture.runtime"],
|
|
64
|
-
ownership_boundaries: [{
|
|
65
|
-
subject_ref: "capability.fixture.runtime", data_owner: "runtime", access_owner: "runtime",
|
|
66
|
-
lifecycle_owner: "runtime", interface_owner: "runtime", runtime_owner: "runtime",
|
|
67
|
-
}],
|
|
68
|
-
required_relations: ["component.fixture.runtime->capability.fixture.runtime"],
|
|
69
|
-
allowed_relations: [], forbidden_relations: ["capability.fixture.runtime->capability.fixture.legacy"],
|
|
70
|
-
required_dependencies: [], forbidden_dependencies: ["fixture/runtime->fixture/legacy"],
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function continuityEvidence(repositoryId) {
|
|
76
|
-
return {
|
|
77
|
-
task_digest: technology.sha256(`task:${repositoryId}`, true),
|
|
78
|
-
outcome: `Exact target binding verified for ${repositoryId}`,
|
|
79
|
-
requirement_refs: ["requirement.fixture.runtime"],
|
|
80
|
-
evidence_refs: ["repo://fixture/evidence/project-technology"],
|
|
81
|
-
checks: [{ id: "check.fixture.binding", verdict: "pass", evidence_ref: "repo://fixture/evidence/project-technology" }],
|
|
82
|
-
changed_surfaces: ["graph/specs/project-continuity.json"],
|
|
83
|
-
case_signature: "case.fixture.target-binding",
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function initRepo(root, name, scope = "repository", profiles) {
|
|
88
|
-
const repo = path.join(root, name); fs.mkdirSync(repo, { recursive: true });
|
|
89
|
-
git(repo, "init", "-q"); git(repo, "config", "user.name", "Mirai Fixture");
|
|
90
|
-
git(repo, "config", "user.email", "fixture@example.invalid");
|
|
91
|
-
writeJson(path.join(repo, "graph.json"), manifest(name, scope, profiles));
|
|
92
|
-
writeJson(path.join(repo, "graph/specs/index.json"), { object_files: [] });
|
|
93
|
-
writeJson(path.join(repo, "graph/specs/relations.json"), []);
|
|
94
|
-
fs.writeFileSync(path.join(repo, "README.md"), `# ${name}\n`);
|
|
95
|
-
git(repo, "add", "."); git(repo, "commit", "-qm", "fixture manifest");
|
|
96
|
-
return repo;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function addTarget(repo, contract = executionContract(), lifecycle = "accepted") {
|
|
100
|
-
const relative = `graph/specs/objects/${TARGET_ID}.json`;
|
|
101
|
-
writeJson(path.join(repo, relative), {
|
|
102
|
-
id: TARGET_ID, kind: "knowledge", subtype: "target_outcome", tz_role: "system",
|
|
103
|
-
title: "Accepted fixture target", lifecycle, semantic_digest: SEMANTIC_DIGEST,
|
|
104
|
-
source_refs: ["repo://fixture-provider/graph/specs?rev=fixture"],
|
|
105
|
-
provider_execution_contract: contract,
|
|
106
|
-
});
|
|
107
|
-
writeJson(path.join(repo, "graph/specs/index.json"), { object_files: [`objects/${TARGET_ID}.json`] });
|
|
108
|
-
git(repo, "add", "graph/specs"); git(repo, "commit", "-qm", "accepted target");
|
|
109
|
-
return git(repo, "rev-parse", "HEAD");
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const checks = [];
|
|
113
|
-
function check(id, condition, details = null) {
|
|
114
|
-
checks.push({ id, passed: Boolean(condition), details });
|
|
115
|
-
assert.ok(condition, `${id}: ${JSON.stringify(details)}`);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "mirai-project-technology-test-"));
|
|
119
|
-
process.env.MIRAI_GRAPH_STATE_ROOT = path.join(root, "host-state");
|
|
120
|
-
try {
|
|
121
|
-
const provider = initRepo(root, "fixture-provider", "repository");
|
|
122
|
-
const consumer = initRepo(root, "fixture-consumer", "repository");
|
|
123
|
-
const consumerTwo = initRepo(root, "fixture-consumer-two", "repository");
|
|
124
|
-
const skill = initRepo(root, "fixture-skill", "skill", ["skill_runtime"]);
|
|
125
|
-
const federation = initRepo(root, "fixture-federation", "federation", ["project_management", "implementation_control"]);
|
|
126
|
-
const providerRevision = addTarget(provider);
|
|
127
|
-
|
|
128
|
-
const legacyRuntimeRepo = initRepo(root, "legacy-runtime-repository");
|
|
129
|
-
writeJson(path.join(legacyRuntimeRepo, ".mirai-graph/project-technology/inventory.json"), { schema_version: "1.0.0", repository_id: "legacy-runtime-repository", inventory_digest: `sha256:${"0".repeat(64)}`, files: [] });
|
|
130
|
-
const legacyRuntimeEnabled = technology.execute("enable", legacyRuntimeRepo, { apply: true });
|
|
131
|
-
check("project_local_runtime_moves_to_host_state", legacyRuntimeEnabled.status === "success" && legacyRuntimeEnabled.migration_ref.startsWith("host-local://") && fs.existsSync(path.join(legacyRuntimeRepo, ".mirai-graph/project-technology/inventory.json")), legacyRuntimeEnabled);
|
|
132
|
-
|
|
133
|
-
const before = fs.readFileSync(path.join(consumer, "graph.json"));
|
|
134
|
-
const preview = technology.execute("enable", consumer, { apply: false });
|
|
135
|
-
check("preview_is_zero_write", preview.status === "preview" && fs.readFileSync(path.join(consumer, "graph.json")).equals(before));
|
|
136
|
-
check("read_only_diagnostics_available", technology.status(consumer).operation_mode === "read_only");
|
|
137
|
-
|
|
138
|
-
for (const repo of [provider, consumer, consumerTwo, skill, federation]) {
|
|
139
|
-
const enabled = technology.execute("enable", repo, { apply: true });
|
|
140
|
-
check(`enable_${path.basename(repo)}`, enabled.status === "success", enabled.blockers);
|
|
141
|
-
check(`sync_idempotent_${path.basename(repo)}`, technology.execute("sync", repo, { apply: true }).changed === false);
|
|
142
|
-
}
|
|
143
|
-
check("skill_runtime_uses_same_engine", technology.context(skill, { task: "skill runtime policy" }).operation_id === "mirai.project_technology.context");
|
|
144
|
-
check("federation_scope_uses_same_engine", technology.status(federation).repository_id === "fixture-federation");
|
|
145
|
-
|
|
146
|
-
const provided = technology.execute("provide", provider, {
|
|
147
|
-
apply: true, targetId: TARGET_ID, semanticDigest: SEMANTIC_DIGEST, providerRevision,
|
|
148
|
-
});
|
|
149
|
-
check("bounded_provider_export", provided.status === "success", provided.blockers);
|
|
150
|
-
const exportPath = path.join(provider, provided.export_ref);
|
|
151
|
-
const exportText = fs.readFileSync(exportPath, "utf8");
|
|
152
|
-
check("export_has_no_private_source", !exportText.includes("source/private") && !exportText.includes("README content"));
|
|
153
|
-
|
|
154
|
-
const unboundProvider = initRepo(root, "unbound-provider");
|
|
155
|
-
const unboundRevision = addTarget(unboundProvider);
|
|
156
|
-
technology.execute("enable", unboundProvider, { apply: true });
|
|
157
|
-
const unboundTarget = path.join(unboundProvider, `graph/specs/objects/${TARGET_ID}.json`);
|
|
158
|
-
fs.appendFileSync(unboundTarget, " ");
|
|
159
|
-
const unboundResult = technology.execute("provide", unboundProvider, {
|
|
160
|
-
apply: true, targetId: TARGET_ID, semanticDigest: SEMANTIC_DIGEST, providerRevision: unboundRevision,
|
|
161
|
-
});
|
|
162
|
-
check("uncommitted_target_cannot_be_exported", unboundResult.status === "fail" && unboundResult.blockers.includes("provider_target_object_not_revision_bound"), unboundResult.blockers);
|
|
163
|
-
|
|
164
|
-
const connected = technology.execute("connect", consumer, {
|
|
165
|
-
apply: true, source: exportPath, targetId: TARGET_ID,
|
|
166
|
-
semanticDigest: SEMANTIC_DIGEST, providerRevision,
|
|
167
|
-
});
|
|
168
|
-
const consumerContinuity = technology.execute("sync", consumer, {
|
|
169
|
-
apply: true, boundary: "task_complete", continuityEvidence: continuityEvidence("fixture-consumer"),
|
|
170
|
-
});
|
|
171
|
-
check("consumer_binding_ready", connected.status === "success" && consumerContinuity.status === "success" && technology.verify(consumer, { significantWork: true }).status === "success", { connect: connected.blockers, continuity: consumerContinuity.blockers });
|
|
172
|
-
const connectedTwo = technology.execute("connect", consumerTwo, {
|
|
173
|
-
apply: true, source: exportPath, targetId: TARGET_ID,
|
|
174
|
-
semanticDigest: SEMANTIC_DIGEST, providerRevision,
|
|
175
|
-
});
|
|
176
|
-
const consumerTwoContinuity = technology.execute("sync", consumerTwo, {
|
|
177
|
-
apply: true, boundary: "task_complete", continuityEvidence: continuityEvidence("fixture-consumer-two"),
|
|
178
|
-
});
|
|
179
|
-
check("second_consumer_binding_ready", connectedTwo.status === "success" && consumerTwoContinuity.status === "success" && technology.verify(consumerTwo, { significantWork: true }).status === "success", { connect: connectedTwo.blockers, continuity: consumerTwoContinuity.blockers });
|
|
180
|
-
const repeated = technology.execute("connect", consumer, {
|
|
181
|
-
apply: true, source: exportPath, targetId: TARGET_ID,
|
|
182
|
-
semanticDigest: SEMANTIC_DIGEST, providerRevision,
|
|
183
|
-
});
|
|
184
|
-
check("repeated_connect_byte_identical", repeated.status === "success" && repeated.changed === false, repeated.blockers);
|
|
185
|
-
|
|
186
|
-
fs.appendFileSync(path.join(provider, "README.md"), "forward revision\n");
|
|
187
|
-
git(provider, "add", "README.md"); git(provider, "commit", "-qm", "forward provider revision");
|
|
188
|
-
const nextRevision = git(provider, "rev-parse", "HEAD");
|
|
189
|
-
const nextProvided = technology.execute("provide", provider, {
|
|
190
|
-
apply: true, targetId: TARGET_ID, semanticDigest: SEMANTIC_DIGEST, providerRevision: nextRevision,
|
|
191
|
-
});
|
|
192
|
-
const refresh = technology.execute("connect", consumer, {
|
|
193
|
-
apply: true, refreshBinding: true, source: path.join(provider, nextProvided.export_ref),
|
|
194
|
-
targetId: TARGET_ID, semanticDigest: SEMANTIC_DIGEST, providerRevision: nextRevision,
|
|
195
|
-
});
|
|
196
|
-
check("forward_refresh_preserves_contract", refresh.status === "success" && refresh.changed, refresh.blockers);
|
|
197
|
-
const refreshAgain = technology.execute("connect", consumer, {
|
|
198
|
-
apply: true, refreshBinding: true, source: path.join(provider, nextProvided.export_ref),
|
|
199
|
-
targetId: TARGET_ID, semanticDigest: SEMANTIC_DIGEST, providerRevision: nextRevision,
|
|
200
|
-
});
|
|
201
|
-
check("refresh_is_idempotent", refreshAgain.status === "success" && refreshAgain.changed === false, refreshAgain.blockers);
|
|
202
|
-
|
|
203
|
-
const conflictingProvider = path.join(root, "conflicting-provider");
|
|
204
|
-
git(root, "clone", "-q", provider, conflictingProvider);
|
|
205
|
-
const conflictingPayload = JSON.parse(fs.readFileSync(path.join(provider, nextProvided.export_ref), "utf8"));
|
|
206
|
-
conflictingPayload.non_goal_ids = ["non_goal.fixture.other_runtime"];
|
|
207
|
-
const normalizedConflict = technology.normalizeExecutionContract(conflictingPayload).contract;
|
|
208
|
-
conflictingPayload.execution_contract_digest = technology.sha256(technology.canonicalBytes(normalizedConflict));
|
|
209
|
-
const conflictingExport = path.join(conflictingProvider, "graph/generated/project-technology/conflicting-target-export.json");
|
|
210
|
-
writeJson(conflictingExport, conflictingPayload);
|
|
211
|
-
const providerConflict = technology.execute("connect", consumer, {
|
|
212
|
-
apply: true, source: conflictingExport, targetId: TARGET_ID,
|
|
213
|
-
semanticDigest: SEMANTIC_DIGEST, providerRevision: nextRevision,
|
|
214
|
-
});
|
|
215
|
-
check("two_provider_conflict_fails_closed", providerConflict.status === "fail" && providerConflict.blockers.includes("target_provider_conflict"), providerConflict.blockers);
|
|
216
|
-
|
|
217
|
-
const downgrade = technology.execute("connect", consumer, {
|
|
218
|
-
apply: true, refreshBinding: true, source: exportPath,
|
|
219
|
-
targetId: TARGET_ID, semanticDigest: SEMANTIC_DIGEST, providerRevision,
|
|
220
|
-
});
|
|
221
|
-
check("provider_downgrade_fails_closed", downgrade.status === "fail" && downgrade.blockers.includes("provider_revision_not_forward"), downgrade.blockers);
|
|
222
|
-
|
|
223
|
-
fs.appendFileSync(path.join(provider, "README.md"), "provider moved without export\n");
|
|
224
|
-
git(provider, "add", "README.md"); git(provider, "commit", "-qm", "provider moved past export");
|
|
225
|
-
const staleProvider = technology.execute("connect", consumer, {
|
|
226
|
-
apply: true, refreshBinding: true, source: path.join(provider, nextProvided.export_ref),
|
|
227
|
-
targetId: TARGET_ID, semanticDigest: SEMANTIC_DIGEST, providerRevision: nextRevision,
|
|
228
|
-
});
|
|
229
|
-
check("stale_provider_export_fails_closed", staleProvider.status === "fail" && staleProvider.blockers.includes("provider_revision_does_not_match_head"), staleProvider.blockers);
|
|
230
|
-
|
|
231
|
-
const wrongTarget = technology.execute("connect", initRepo(root, "wrong-target"), {
|
|
232
|
-
apply: true, source: exportPath, targetId: "fixture.target.other",
|
|
233
|
-
semanticDigest: SEMANTIC_DIGEST, providerRevision,
|
|
234
|
-
});
|
|
235
|
-
check("target_mismatch_fails_closed", wrongTarget.status === "fail" && wrongTarget.blockers.includes("target_id_mismatch"), wrongTarget.blockers);
|
|
236
|
-
const wrongDigest = technology.execute("connect", initRepo(root, "wrong-digest"), {
|
|
237
|
-
apply: true, source: exportPath, targetId: TARGET_ID,
|
|
238
|
-
semanticDigest: `sha256:${"3".repeat(64)}`, providerRevision,
|
|
239
|
-
});
|
|
240
|
-
check("digest_mismatch_fails_closed", wrongDigest.status === "fail" && wrongDigest.blockers.includes("semantic_digest_mismatch"), wrongDigest.blockers);
|
|
241
|
-
|
|
242
|
-
const tampered = path.join(root, "tampered.json");
|
|
243
|
-
const tamperedPayload = JSON.parse(exportText); tamperedPayload.non_goal_ids = ["non_goal.fixture.tampered"];
|
|
244
|
-
writeJson(tampered, tamperedPayload);
|
|
245
|
-
check("tampered_contract_fails_closed", technology.readExport(tampered).blockers.includes("provider_execution_contract_digest_mismatch"));
|
|
246
|
-
|
|
247
|
-
const incomplete = executionContract(); incomplete.requirement_bindings = [];
|
|
248
|
-
check("incomplete_contract_fails_closed", technology.normalizeExecutionContract(incomplete).blockers.includes("provider_contract_requirement_bindings_empty"));
|
|
249
|
-
const cycle = executionContract(); cycle.architecture_contract.required_dependencies = ["aa->bb", "bb->aa"];
|
|
250
|
-
check("dependency_cycle_fails_closed", technology.normalizeExecutionContract(cycle).blockers.includes("provider_architecture_dependency_cycle"));
|
|
251
|
-
check("blocked_significant_work_keeps_status", technology.verify(skill, { significantWork: true }).status === "blocked" && technology.status(skill).operation_mode === "read_only");
|
|
252
|
-
|
|
253
|
-
const disabled = technology.execute("disable", skill, { apply: true });
|
|
254
|
-
check("disabled_state_fails_closed", disabled.status === "success" && technology.verify(skill, { significantWork: true }).status === "blocked");
|
|
255
|
-
|
|
256
|
-
const largeProvider = initRepo(root, "large-provider");
|
|
257
|
-
addTarget(largeProvider);
|
|
258
|
-
const emptyBlob = spawnSync("git", ["hash-object", "-w", "--stdin"], {
|
|
259
|
-
cwd: largeProvider, input: "", encoding: "utf8",
|
|
260
|
-
}).stdout.trim();
|
|
261
|
-
const padding = "x".repeat(190);
|
|
262
|
-
const indexInfo = Array.from({ length: 5200 }, (_, index) =>
|
|
263
|
-
`100644 ${emptyBlob}\tarchive/${String(index).padStart(5, "0")}-${padding}.txt\n`
|
|
264
|
-
).join("");
|
|
265
|
-
const indexed = spawnSync("git", ["update-index", "--index-info"], {
|
|
266
|
-
cwd: largeProvider, input: indexInfo, encoding: "utf8", maxBuffer: 64 * 1024 * 1024,
|
|
267
|
-
});
|
|
268
|
-
check("large_repository_fixture_created", indexed.status === 0, indexed.stderr);
|
|
269
|
-
git(largeProvider, "commit", "-qm", "large tracked index");
|
|
270
|
-
const largeRevision = git(largeProvider, "rev-parse", "HEAD");
|
|
271
|
-
check("large_repository_enable", technology.execute("enable", largeProvider, { apply: true }).status === "success");
|
|
272
|
-
const largeProvided = technology.execute("provide", largeProvider, {
|
|
273
|
-
apply: true, targetId: TARGET_ID, semanticDigest: SEMANTIC_DIGEST, providerRevision: largeRevision,
|
|
274
|
-
});
|
|
275
|
-
check("large_repository_target_is_not_lost_to_process_buffer", largeProvided.status === "success", largeProvided.blockers);
|
|
276
|
-
|
|
277
|
-
const cli = spawnSync(process.execPath, [path.join(__dirname, "mirai-graph.js"), "technology", "explain", federation], { encoding: "utf8" });
|
|
278
|
-
const cliResult = JSON.parse(cli.stdout);
|
|
279
|
-
check("unified_cli_contract", cli.status === 0 && cliResult.operation_id === "mirai.project_technology.explain" && cliResult.operation_mode === "read_only");
|
|
280
|
-
|
|
281
|
-
const cliFromCwd = spawnSync(process.execPath, [path.join(__dirname, "mirai-graph.js"), "technology", "status"], {
|
|
282
|
-
cwd: federation, encoding: "utf8",
|
|
283
|
-
});
|
|
284
|
-
const cliFromCwdResult = JSON.parse(cliFromCwd.stdout);
|
|
285
|
-
check("unified_cli_defaults_to_caller_cwd", cliFromCwd.status === 0 && cliFromCwdResult.repository_id === "fixture-federation", cliFromCwdResult);
|
|
286
|
-
|
|
287
|
-
const cliDot = spawnSync(process.execPath, [path.join(__dirname, "mirai-graph.js"), "technology", "status", "."], {
|
|
288
|
-
cwd: federation, encoding: "utf8",
|
|
289
|
-
});
|
|
290
|
-
const cliDotResult = JSON.parse(cliDot.stdout);
|
|
291
|
-
check("unified_cli_resolves_relative_repo_from_caller_cwd", cliDot.status === 0 && cliDotResult.repository_id === "fixture-federation", cliDotResult);
|
|
292
|
-
|
|
293
|
-
process.stdout.write(`${JSON.stringify({ status: "success", checks_passed: checks.length, checks_failed: 0, checks }, null, 2)}\n`);
|
|
294
|
-
} finally {
|
|
295
|
-
fs.rmSync(root, { recursive: true, force: true });
|
|
296
|
-
}
|