@jeger-ai/opengantry 1.0.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/LICENSE +235 -0
- package/NOTICE +16 -0
- package/README.md +337 -0
- package/dist/cli/commands/arch.d.ts +19 -0
- package/dist/cli/commands/arch.d.ts.map +1 -0
- package/dist/cli/commands/arch.js +86 -0
- package/dist/cli/commands/arch.js.map +1 -0
- package/dist/cli/commands/check.d.ts +2 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +16 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +12 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +40 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init.d.ts +18 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +185 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/legislate.d.ts +21 -0
- package/dist/cli/commands/legislate.d.ts.map +1 -0
- package/dist/cli/commands/legislate.js +143 -0
- package/dist/cli/commands/legislate.js.map +1 -0
- package/dist/cli/commands/mcp-serve.d.ts +2 -0
- package/dist/cli/commands/mcp-serve.d.ts.map +1 -0
- package/dist/cli/commands/mcp-serve.js +14 -0
- package/dist/cli/commands/mcp-serve.js.map +1 -0
- package/dist/cli/commands/metrics.d.ts +6 -0
- package/dist/cli/commands/metrics.d.ts.map +1 -0
- package/dist/cli/commands/metrics.js +20 -0
- package/dist/cli/commands/metrics.js.map +1 -0
- package/dist/cli/commands/mission.d.ts +3 -0
- package/dist/cli/commands/mission.d.ts.map +1 -0
- package/dist/cli/commands/mission.js +29 -0
- package/dist/cli/commands/mission.js.map +1 -0
- package/dist/cli/commands/onboarding.d.ts +2 -0
- package/dist/cli/commands/onboarding.d.ts.map +1 -0
- package/dist/cli/commands/onboarding.js +85 -0
- package/dist/cli/commands/onboarding.js.map +1 -0
- package/dist/cli/commands/runtime.d.ts +19 -0
- package/dist/cli/commands/runtime.d.ts.map +1 -0
- package/dist/cli/commands/runtime.js +101 -0
- package/dist/cli/commands/runtime.js.map +1 -0
- package/dist/cli/commands/start.d.ts +4 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/commands/start.js +3 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/status.d.ts +8 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +65 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/teacher.d.ts +11 -0
- package/dist/cli/commands/teacher.d.ts.map +1 -0
- package/dist/cli/commands/teacher.js +48 -0
- package/dist/cli/commands/teacher.js.map +1 -0
- package/dist/cli/commands/triage.d.ts +10 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +48 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/upgrade.d.ts +10 -0
- package/dist/cli/commands/upgrade.d.ts.map +1 -0
- package/dist/cli/commands/upgrade.js +89 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +6 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +33 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +13 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/lib/agent-error.d.ts +20 -0
- package/dist/cli/lib/agent-error.d.ts.map +1 -0
- package/dist/cli/lib/agent-error.js +58 -0
- package/dist/cli/lib/agent-error.js.map +1 -0
- package/dist/cli/lib/architecture-credential.d.ts +22 -0
- package/dist/cli/lib/architecture-credential.d.ts.map +1 -0
- package/dist/cli/lib/architecture-credential.js +198 -0
- package/dist/cli/lib/architecture-credential.js.map +1 -0
- package/dist/cli/lib/architecture-pointer-discovery.d.ts +7 -0
- package/dist/cli/lib/architecture-pointer-discovery.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer-discovery.js +60 -0
- package/dist/cli/lib/architecture-pointer-discovery.js.map +1 -0
- package/dist/cli/lib/architecture-pointer-doctor.d.ts +3 -0
- package/dist/cli/lib/architecture-pointer-doctor.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer-doctor.js +114 -0
- package/dist/cli/lib/architecture-pointer-doctor.js.map +1 -0
- package/dist/cli/lib/architecture-pointer-schema.d.ts +5 -0
- package/dist/cli/lib/architecture-pointer-schema.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer-schema.js +137 -0
- package/dist/cli/lib/architecture-pointer-schema.js.map +1 -0
- package/dist/cli/lib/architecture-pointer-types.d.ts +24 -0
- package/dist/cli/lib/architecture-pointer-types.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer-types.js +7 -0
- package/dist/cli/lib/architecture-pointer-types.js.map +1 -0
- package/dist/cli/lib/architecture-pointer.d.ts +7 -0
- package/dist/cli/lib/architecture-pointer.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer.js +10 -0
- package/dist/cli/lib/architecture-pointer.js.map +1 -0
- package/dist/cli/lib/atomic-fs.d.ts +9 -0
- package/dist/cli/lib/atomic-fs.d.ts.map +1 -0
- package/dist/cli/lib/atomic-fs.js +63 -0
- package/dist/cli/lib/atomic-fs.js.map +1 -0
- package/dist/cli/lib/audience-output.d.ts +18 -0
- package/dist/cli/lib/audience-output.d.ts.map +1 -0
- package/dist/cli/lib/audience-output.js +80 -0
- package/dist/cli/lib/audience-output.js.map +1 -0
- package/dist/cli/lib/break-glass.d.ts +25 -0
- package/dist/cli/lib/break-glass.d.ts.map +1 -0
- package/dist/cli/lib/break-glass.js +134 -0
- package/dist/cli/lib/break-glass.js.map +1 -0
- package/dist/cli/lib/cli-io.d.ts +9 -0
- package/dist/cli/lib/cli-io.d.ts.map +1 -0
- package/dist/cli/lib/cli-io.js +38 -0
- package/dist/cli/lib/cli-io.js.map +1 -0
- package/dist/cli/lib/cli-timeout.d.ts +9 -0
- package/dist/cli/lib/cli-timeout.d.ts.map +1 -0
- package/dist/cli/lib/cli-timeout.js +17 -0
- package/dist/cli/lib/cli-timeout.js.map +1 -0
- package/dist/cli/lib/constants.d.ts +26 -0
- package/dist/cli/lib/constants.d.ts.map +1 -0
- package/dist/cli/lib/constants.js +26 -0
- package/dist/cli/lib/constants.js.map +1 -0
- package/dist/cli/lib/dirty-missions.d.ts +8 -0
- package/dist/cli/lib/dirty-missions.d.ts.map +1 -0
- package/dist/cli/lib/dirty-missions.js +65 -0
- package/dist/cli/lib/dirty-missions.js.map +1 -0
- package/dist/cli/lib/doctor-checks.d.ts +16 -0
- package/dist/cli/lib/doctor-checks.d.ts.map +1 -0
- package/dist/cli/lib/doctor-checks.js +138 -0
- package/dist/cli/lib/doctor-checks.js.map +1 -0
- package/dist/cli/lib/doctor-integration-checks.d.ts +5 -0
- package/dist/cli/lib/doctor-integration-checks.d.ts.map +1 -0
- package/dist/cli/lib/doctor-integration-checks.js +88 -0
- package/dist/cli/lib/doctor-integration-checks.js.map +1 -0
- package/dist/cli/lib/doctor-orchestration.d.ts +10 -0
- package/dist/cli/lib/doctor-orchestration.d.ts.map +1 -0
- package/dist/cli/lib/doctor-orchestration.js +25 -0
- package/dist/cli/lib/doctor-orchestration.js.map +1 -0
- package/dist/cli/lib/draft-token.d.ts +37 -0
- package/dist/cli/lib/draft-token.d.ts.map +1 -0
- package/dist/cli/lib/draft-token.js +171 -0
- package/dist/cli/lib/draft-token.js.map +1 -0
- package/dist/cli/lib/fix-hints.d.ts +51 -0
- package/dist/cli/lib/fix-hints.d.ts.map +1 -0
- package/dist/cli/lib/fix-hints.js +197 -0
- package/dist/cli/lib/fix-hints.js.map +1 -0
- package/dist/cli/lib/forbidden-scan.d.ts +18 -0
- package/dist/cli/lib/forbidden-scan.d.ts.map +1 -0
- package/dist/cli/lib/forbidden-scan.js +96 -0
- package/dist/cli/lib/forbidden-scan.js.map +1 -0
- package/dist/cli/lib/gate.d.ts +10 -0
- package/dist/cli/lib/gate.d.ts.map +1 -0
- package/dist/cli/lib/gate.js +30 -0
- package/dist/cli/lib/gate.js.map +1 -0
- package/dist/cli/lib/git-metrics-missions.d.ts +3 -0
- package/dist/cli/lib/git-metrics-missions.d.ts.map +1 -0
- package/dist/cli/lib/git-metrics-missions.js +51 -0
- package/dist/cli/lib/git-metrics-missions.js.map +1 -0
- package/dist/cli/lib/git-metrics-stream.d.ts +24 -0
- package/dist/cli/lib/git-metrics-stream.d.ts.map +1 -0
- package/dist/cli/lib/git-metrics-stream.js +137 -0
- package/dist/cli/lib/git-metrics-stream.js.map +1 -0
- package/dist/cli/lib/git-metrics.d.ts +18 -0
- package/dist/cli/lib/git-metrics.d.ts.map +1 -0
- package/dist/cli/lib/git-metrics.js +39 -0
- package/dist/cli/lib/git-metrics.js.map +1 -0
- package/dist/cli/lib/git-proof-errors.d.ts +3 -0
- package/dist/cli/lib/git-proof-errors.d.ts.map +1 -0
- package/dist/cli/lib/git-proof-errors.js +7 -0
- package/dist/cli/lib/git-proof-errors.js.map +1 -0
- package/dist/cli/lib/git-proof.d.ts +37 -0
- package/dist/cli/lib/git-proof.d.ts.map +1 -0
- package/dist/cli/lib/git-proof.js +147 -0
- package/dist/cli/lib/git-proof.js.map +1 -0
- package/dist/cli/lib/git-repo.d.ts +17 -0
- package/dist/cli/lib/git-repo.d.ts.map +1 -0
- package/dist/cli/lib/git-repo.js +39 -0
- package/dist/cli/lib/git-repo.js.map +1 -0
- package/dist/cli/lib/git.d.ts +2 -0
- package/dist/cli/lib/git.d.ts.map +1 -0
- package/dist/cli/lib/git.js +19 -0
- package/dist/cli/lib/git.js.map +1 -0
- package/dist/cli/lib/gitignore-gxt.d.ts +2 -0
- package/dist/cli/lib/gitignore-gxt.d.ts.map +1 -0
- package/dist/cli/lib/gitignore-gxt.js +24 -0
- package/dist/cli/lib/gitignore-gxt.js.map +1 -0
- package/dist/cli/lib/gxt-error-codes.d.ts +19 -0
- package/dist/cli/lib/gxt-error-codes.d.ts.map +1 -0
- package/dist/cli/lib/gxt-error-codes.js +60 -0
- package/dist/cli/lib/gxt-error-codes.js.map +1 -0
- package/dist/cli/lib/init-asset-catalog.d.ts +15 -0
- package/dist/cli/lib/init-asset-catalog.d.ts.map +1 -0
- package/dist/cli/lib/init-asset-catalog.js +163 -0
- package/dist/cli/lib/init-asset-catalog.js.map +1 -0
- package/dist/cli/lib/init-assets.d.ts +8 -0
- package/dist/cli/lib/init-assets.d.ts.map +1 -0
- package/dist/cli/lib/init-assets.js +3 -0
- package/dist/cli/lib/init-assets.js.map +1 -0
- package/dist/cli/lib/init-compose-arch-pointer.d.ts +6 -0
- package/dist/cli/lib/init-compose-arch-pointer.d.ts.map +1 -0
- package/dist/cli/lib/init-compose-arch-pointer.js +64 -0
- package/dist/cli/lib/init-compose-arch-pointer.js.map +1 -0
- package/dist/cli/lib/init-compose-doc.d.ts +5 -0
- package/dist/cli/lib/init-compose-doc.d.ts.map +1 -0
- package/dist/cli/lib/init-compose-doc.js +37 -0
- package/dist/cli/lib/init-compose-doc.js.map +1 -0
- package/dist/cli/lib/init-interactive.d.ts +8 -0
- package/dist/cli/lib/init-interactive.d.ts.map +1 -0
- package/dist/cli/lib/init-interactive.js +195 -0
- package/dist/cli/lib/init-interactive.js.map +1 -0
- package/dist/cli/lib/init-plan.d.ts +20 -0
- package/dist/cli/lib/init-plan.d.ts.map +1 -0
- package/dist/cli/lib/init-plan.js +92 -0
- package/dist/cli/lib/init-plan.js.map +1 -0
- package/dist/cli/lib/init-profile.d.ts +39 -0
- package/dist/cli/lib/init-profile.d.ts.map +1 -0
- package/dist/cli/lib/init-profile.js +93 -0
- package/dist/cli/lib/init-profile.js.map +1 -0
- package/dist/cli/lib/init-tutorial.d.ts +2 -0
- package/dist/cli/lib/init-tutorial.d.ts.map +1 -0
- package/dist/cli/lib/init-tutorial.js +156 -0
- package/dist/cli/lib/init-tutorial.js.map +1 -0
- package/dist/cli/lib/integration-compat.d.ts +24 -0
- package/dist/cli/lib/integration-compat.d.ts.map +1 -0
- package/dist/cli/lib/integration-compat.js +50 -0
- package/dist/cli/lib/integration-compat.js.map +1 -0
- package/dist/cli/lib/legislate-skill.d.ts +20 -0
- package/dist/cli/lib/legislate-skill.d.ts.map +1 -0
- package/dist/cli/lib/legislate-skill.js +30 -0
- package/dist/cli/lib/legislate-skill.js.map +1 -0
- package/dist/cli/lib/manifest.d.ts +6 -0
- package/dist/cli/lib/manifest.d.ts.map +1 -0
- package/dist/cli/lib/manifest.js +53 -0
- package/dist/cli/lib/manifest.js.map +1 -0
- package/dist/cli/lib/mcp-legislation.d.ts +82 -0
- package/dist/cli/lib/mcp-legislation.d.ts.map +1 -0
- package/dist/cli/lib/mcp-legislation.js +181 -0
- package/dist/cli/lib/mcp-legislation.js.map +1 -0
- package/dist/cli/lib/mcp-orchestration.d.ts +12 -0
- package/dist/cli/lib/mcp-orchestration.d.ts.map +1 -0
- package/dist/cli/lib/mcp-orchestration.js +54 -0
- package/dist/cli/lib/mcp-orchestration.js.map +1 -0
- package/dist/cli/lib/mcp-runtime.d.ts +60 -0
- package/dist/cli/lib/mcp-runtime.d.ts.map +1 -0
- package/dist/cli/lib/mcp-runtime.js +133 -0
- package/dist/cli/lib/mcp-runtime.js.map +1 -0
- package/dist/cli/lib/mcp-tools-register.d.ts +4 -0
- package/dist/cli/lib/mcp-tools-register.d.ts.map +1 -0
- package/dist/cli/lib/mcp-tools-register.js +78 -0
- package/dist/cli/lib/mcp-tools-register.js.map +1 -0
- package/dist/cli/lib/mcp-upgrade.d.ts +7 -0
- package/dist/cli/lib/mcp-upgrade.d.ts.map +1 -0
- package/dist/cli/lib/mcp-upgrade.js +38 -0
- package/dist/cli/lib/mcp-upgrade.js.map +1 -0
- package/dist/cli/lib/mission-emit.d.ts +7 -0
- package/dist/cli/lib/mission-emit.d.ts.map +1 -0
- package/dist/cli/lib/mission-emit.js +23 -0
- package/dist/cli/lib/mission-emit.js.map +1 -0
- package/dist/cli/lib/mission-legislative-stub.d.ts +9 -0
- package/dist/cli/lib/mission-legislative-stub.d.ts.map +1 -0
- package/dist/cli/lib/mission-legislative-stub.js +36 -0
- package/dist/cli/lib/mission-legislative-stub.js.map +1 -0
- package/dist/cli/lib/mission-markdown.d.ts +6 -0
- package/dist/cli/lib/mission-markdown.d.ts.map +1 -0
- package/dist/cli/lib/mission-markdown.js +84 -0
- package/dist/cli/lib/mission-markdown.js.map +1 -0
- package/dist/cli/lib/mission-msn.d.ts +10 -0
- package/dist/cli/lib/mission-msn.d.ts.map +1 -0
- package/dist/cli/lib/mission-msn.js +85 -0
- package/dist/cli/lib/mission-msn.js.map +1 -0
- package/dist/cli/lib/mission-parser.d.ts +6 -0
- package/dist/cli/lib/mission-parser.d.ts.map +1 -0
- package/dist/cli/lib/mission-parser.js +29 -0
- package/dist/cli/lib/mission-parser.js.map +1 -0
- package/dist/cli/lib/mission-path.d.ts +4 -0
- package/dist/cli/lib/mission-path.d.ts.map +1 -0
- package/dist/cli/lib/mission-path.js +28 -0
- package/dist/cli/lib/mission-path.js.map +1 -0
- package/dist/cli/lib/mission-resolution.d.ts +14 -0
- package/dist/cli/lib/mission-resolution.d.ts.map +1 -0
- package/dist/cli/lib/mission-resolution.js +60 -0
- package/dist/cli/lib/mission-resolution.js.map +1 -0
- package/dist/cli/lib/mission-yaml.d.ts +12 -0
- package/dist/cli/lib/mission-yaml.d.ts.map +1 -0
- package/dist/cli/lib/mission-yaml.js +96 -0
- package/dist/cli/lib/mission-yaml.js.map +1 -0
- package/dist/cli/lib/msn-allocate.d.ts +13 -0
- package/dist/cli/lib/msn-allocate.d.ts.map +1 -0
- package/dist/cli/lib/msn-allocate.js +98 -0
- package/dist/cli/lib/msn-allocate.js.map +1 -0
- package/dist/cli/lib/msn.d.ts +2 -0
- package/dist/cli/lib/msn.d.ts.map +1 -0
- package/dist/cli/lib/msn.js +5 -0
- package/dist/cli/lib/msn.js.map +1 -0
- package/dist/cli/lib/onboarding-flow.d.ts +11 -0
- package/dist/cli/lib/onboarding-flow.d.ts.map +1 -0
- package/dist/cli/lib/onboarding-flow.js +25 -0
- package/dist/cli/lib/onboarding-flow.js.map +1 -0
- package/dist/cli/lib/out-of-scope-hint.d.ts +7 -0
- package/dist/cli/lib/out-of-scope-hint.d.ts.map +1 -0
- package/dist/cli/lib/out-of-scope-hint.js +79 -0
- package/dist/cli/lib/out-of-scope-hint.js.map +1 -0
- package/dist/cli/lib/output-context.d.ts +22 -0
- package/dist/cli/lib/output-context.d.ts.map +1 -0
- package/dist/cli/lib/output-context.js +55 -0
- package/dist/cli/lib/output-context.js.map +1 -0
- package/dist/cli/lib/program-audience-hook.d.ts +4 -0
- package/dist/cli/lib/program-audience-hook.d.ts.map +1 -0
- package/dist/cli/lib/program-audience-hook.js +35 -0
- package/dist/cli/lib/program-audience-hook.js.map +1 -0
- package/dist/cli/lib/runtime-env.d.ts +23 -0
- package/dist/cli/lib/runtime-env.d.ts.map +1 -0
- package/dist/cli/lib/runtime-env.js +64 -0
- package/dist/cli/lib/runtime-env.js.map +1 -0
- package/dist/cli/lib/runtime-exec-orchestrator.d.ts +14 -0
- package/dist/cli/lib/runtime-exec-orchestrator.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec-orchestrator.js +131 -0
- package/dist/cli/lib/runtime-exec-orchestrator.js.map +1 -0
- package/dist/cli/lib/runtime-exec-process.d.ts +23 -0
- package/dist/cli/lib/runtime-exec-process.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec-process.js +55 -0
- package/dist/cli/lib/runtime-exec-process.js.map +1 -0
- package/dist/cli/lib/runtime-exec-result.d.ts +21 -0
- package/dist/cli/lib/runtime-exec-result.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec-result.js +42 -0
- package/dist/cli/lib/runtime-exec-result.js.map +1 -0
- package/dist/cli/lib/runtime-exec-worker.d.ts +18 -0
- package/dist/cli/lib/runtime-exec-worker.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec-worker.js +49 -0
- package/dist/cli/lib/runtime-exec-worker.js.map +1 -0
- package/dist/cli/lib/runtime-exec.d.ts +5 -0
- package/dist/cli/lib/runtime-exec.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec.js +5 -0
- package/dist/cli/lib/runtime-exec.js.map +1 -0
- package/dist/cli/lib/skill-sync.d.ts +11 -0
- package/dist/cli/lib/skill-sync.d.ts.map +1 -0
- package/dist/cli/lib/skill-sync.js +39 -0
- package/dist/cli/lib/skill-sync.js.map +1 -0
- package/dist/cli/lib/start-orchestration.d.ts +29 -0
- package/dist/cli/lib/start-orchestration.d.ts.map +1 -0
- package/dist/cli/lib/start-orchestration.js +176 -0
- package/dist/cli/lib/start-orchestration.js.map +1 -0
- package/dist/cli/lib/start-state.d.ts +12 -0
- package/dist/cli/lib/start-state.d.ts.map +1 -0
- package/dist/cli/lib/start-state.js +86 -0
- package/dist/cli/lib/start-state.js.map +1 -0
- package/dist/cli/lib/status-report.d.ts +21 -0
- package/dist/cli/lib/status-report.d.ts.map +1 -0
- package/dist/cli/lib/status-report.js +77 -0
- package/dist/cli/lib/status-report.js.map +1 -0
- package/dist/cli/lib/substrate-version.d.ts +22 -0
- package/dist/cli/lib/substrate-version.d.ts.map +1 -0
- package/dist/cli/lib/substrate-version.js +97 -0
- package/dist/cli/lib/substrate-version.js.map +1 -0
- package/dist/cli/lib/teacher-identity.d.ts +24 -0
- package/dist/cli/lib/teacher-identity.d.ts.map +1 -0
- package/dist/cli/lib/teacher-identity.js +123 -0
- package/dist/cli/lib/teacher-identity.js.map +1 -0
- package/dist/cli/lib/telemetry-log.d.ts +22 -0
- package/dist/cli/lib/telemetry-log.d.ts.map +1 -0
- package/dist/cli/lib/telemetry-log.js +50 -0
- package/dist/cli/lib/telemetry-log.js.map +1 -0
- package/dist/cli/lib/trace-failure-kind.d.ts +4 -0
- package/dist/cli/lib/trace-failure-kind.d.ts.map +1 -0
- package/dist/cli/lib/trace-failure-kind.js +23 -0
- package/dist/cli/lib/trace-failure-kind.js.map +1 -0
- package/dist/cli/lib/trace.d.ts +25 -0
- package/dist/cli/lib/trace.d.ts.map +1 -0
- package/dist/cli/lib/trace.js +121 -0
- package/dist/cli/lib/trace.js.map +1 -0
- package/dist/cli/lib/triage-logic.d.ts +10 -0
- package/dist/cli/lib/triage-logic.d.ts.map +1 -0
- package/dist/cli/lib/triage-logic.js +105 -0
- package/dist/cli/lib/triage-logic.js.map +1 -0
- package/dist/cli/lib/types.d.ts +62 -0
- package/dist/cli/lib/types.d.ts.map +1 -0
- package/dist/cli/lib/types.js +2 -0
- package/dist/cli/lib/types.js.map +1 -0
- package/dist/cli/lib/upgrade-apply.d.ts +15 -0
- package/dist/cli/lib/upgrade-apply.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-apply.js +122 -0
- package/dist/cli/lib/upgrade-apply.js.map +1 -0
- package/dist/cli/lib/upgrade-eligible-assets.d.ts +5 -0
- package/dist/cli/lib/upgrade-eligible-assets.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-eligible-assets.js +9 -0
- package/dist/cli/lib/upgrade-eligible-assets.js.map +1 -0
- package/dist/cli/lib/upgrade-plan.d.ts +43 -0
- package/dist/cli/lib/upgrade-plan.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-plan.js +220 -0
- package/dist/cli/lib/upgrade-plan.js.map +1 -0
- package/dist/cli/lib/upgrade-profile.d.ts +4 -0
- package/dist/cli/lib/upgrade-profile.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-profile.js +27 -0
- package/dist/cli/lib/upgrade-profile.js.map +1 -0
- package/dist/cli/lib/user-error.d.ts +20 -0
- package/dist/cli/lib/user-error.d.ts.map +1 -0
- package/dist/cli/lib/user-error.js +64 -0
- package/dist/cli/lib/user-error.js.map +1 -0
- package/dist/cli/lib/verify-engine.d.ts +33 -0
- package/dist/cli/lib/verify-engine.d.ts.map +1 -0
- package/dist/cli/lib/verify-engine.js +104 -0
- package/dist/cli/lib/verify-engine.js.map +1 -0
- package/dist/cli/lib/verify-failure-presentation.d.ts +31 -0
- package/dist/cli/lib/verify-failure-presentation.d.ts.map +1 -0
- package/dist/cli/lib/verify-failure-presentation.js +93 -0
- package/dist/cli/lib/verify-failure-presentation.js.map +1 -0
- package/dist/cli/lib/verify-flow.d.ts +21 -0
- package/dist/cli/lib/verify-flow.d.ts.map +1 -0
- package/dist/cli/lib/verify-flow.js +103 -0
- package/dist/cli/lib/verify-flow.js.map +1 -0
- package/dist/cli/lib/verify-repair.d.ts +4 -0
- package/dist/cli/lib/verify-repair.d.ts.map +1 -0
- package/dist/cli/lib/verify-repair.js +61 -0
- package/dist/cli/lib/verify-repair.js.map +1 -0
- package/dist/cli/lib/verify-types.d.ts +21 -0
- package/dist/cli/lib/verify-types.d.ts.map +1 -0
- package/dist/cli/lib/verify-types.js +2 -0
- package/dist/cli/lib/verify-types.js.map +1 -0
- package/dist/cli/lib/version.gen.d.ts +4 -0
- package/dist/cli/lib/version.gen.d.ts.map +1 -0
- package/dist/cli/lib/version.gen.js +4 -0
- package/dist/cli/lib/version.gen.js.map +1 -0
- package/dist/cli/lib/worker-log-line-map.d.ts +12 -0
- package/dist/cli/lib/worker-log-line-map.d.ts.map +1 -0
- package/dist/cli/lib/worker-log-line-map.js +29 -0
- package/dist/cli/lib/worker-log-line-map.js.map +1 -0
- package/dist/cli/lib/workspace.d.ts +11 -0
- package/dist/cli/lib/workspace.d.ts.map +1 -0
- package/dist/cli/lib/workspace.js +14 -0
- package/dist/cli/lib/workspace.js.map +1 -0
- package/dist/cli/program-arch.d.ts +3 -0
- package/dist/cli/program-arch.d.ts.map +1 -0
- package/dist/cli/program-arch.js +45 -0
- package/dist/cli/program-arch.js.map +1 -0
- package/dist/cli/program-core.d.ts +3 -0
- package/dist/cli/program-core.d.ts.map +1 -0
- package/dist/cli/program-core.js +154 -0
- package/dist/cli/program-core.js.map +1 -0
- package/dist/cli/program-mcp.d.ts +3 -0
- package/dist/cli/program-mcp.d.ts.map +1 -0
- package/dist/cli/program-mcp.js +12 -0
- package/dist/cli/program-mcp.js.map +1 -0
- package/dist/cli/program-mission.d.ts +3 -0
- package/dist/cli/program-mission.d.ts.map +1 -0
- package/dist/cli/program-mission.js +77 -0
- package/dist/cli/program-mission.js.map +1 -0
- package/dist/cli/program-teacher.d.ts +3 -0
- package/dist/cli/program-teacher.d.ts.map +1 -0
- package/dist/cli/program-teacher.js +19 -0
- package/dist/cli/program-teacher.js.map +1 -0
- package/dist/cli/program-workflow.d.ts +3 -0
- package/dist/cli/program-workflow.d.ts.map +1 -0
- package/dist/cli/program-workflow.js +81 -0
- package/dist/cli/program-workflow.js.map +1 -0
- package/dist/cli/program.d.ts +4 -0
- package/dist/cli/program.d.ts.map +1 -0
- package/dist/cli/program.js +25 -0
- package/dist/cli/program.js.map +1 -0
- package/package.json +66 -0
- package/templates/.cursor/hooks/gxt-before-shell.sh +63 -0
- package/templates/.cursor/hooks/gxt-session-start.sh +68 -0
- package/templates/.cursor/hooks.json +15 -0
- package/templates/.cursor/mcp.json +8 -0
- package/templates/.cursor/rules/opengantry-gxt-substrate.mdc +43 -0
- package/templates/.gitagent/ARCHITECTURE.pointer.external.example.json +13 -0
- package/templates/.gitagent/ARCHITECTURE.pointer.json +9 -0
- package/templates/.gitagent/foreman/BYPASS.sha256 +2 -0
- package/templates/.gitagent/foreman/MANIFEST.json +37 -0
- package/templates/.gitagent/foreman/SUBSTRATE.version.json +6 -0
- package/templates/.gitagent/foreman/TEACHER.allowlist.example +4 -0
- package/templates/.gitagent/missions/README.md +18 -0
- package/templates/.gitagent/teacher/ARCHITECTURE-ACCESS.md +85 -0
- package/templates/.gitagent/teacher/ARCHITECTURE-DISCOVERY.md +40 -0
- package/templates/.gitagent/teacher/MISSION-ARCHITECT.md +93 -0
- package/templates/.gitagent/teacher/MISSION.schema.yaml +80 -0
- package/templates/.gitagent/teacher/RULES.md +36 -0
- package/templates/.gitagent/teacher/WORKER_LOG.template.md +2 -0
- package/templates/.githooks/post-checkout +26 -0
- package/templates/.githooks/pre-push +53 -0
- package/templates/.github/workflows/gxt-validate.yml +129 -0
- package/templates/.gitignore.gxt +8 -0
- package/templates/AGENTS.md +24 -0
- package/templates/docs/ARCHITECTURE.md +23 -0
- package/templates/integrations/aider/.aider.conf.yml +4 -0
- package/templates/integrations/antigravity/.agent/rules/gxt.md +11 -0
- package/templates/integrations/claude-code/CLAUDE.md +9 -0
- package/templates/integrations/cline/.clinerules/gxt.md +7 -0
- package/templates/integrations/codex-cli/.codex/config.toml +3 -0
- package/templates/integrations/compatibility.json +92 -0
- package/templates/integrations/junie/.junie/guidelines.md +11 -0
- package/templates/integrations/opencode/opencode.json +3 -0
- package/templates/integrations/openhands/.openhands/microagents/gxt.md +11 -0
- package/templates/integrations/recipes/_footer.md +20 -0
- package/templates/integrations/recipes/_preamble.md +46 -0
- package/templates/integrations/recipes/aider.md +13 -0
- package/templates/integrations/recipes/antigravity.md +8 -0
- package/templates/integrations/recipes/claude-code.md +14 -0
- package/templates/integrations/recipes/cline.md +8 -0
- package/templates/integrations/recipes/codex-cli.md +16 -0
- package/templates/integrations/recipes/cursor.md +19 -0
- package/templates/integrations/recipes/junie.md +8 -0
- package/templates/integrations/recipes/opencode.md +8 -0
- package/templates/integrations/recipes/openhands.md +8 -0
- package/templates/scripts/dev-validate.sh +24 -0
- package/templates/scripts/gxt-cursor-env.sh +5 -0
- package/templates/scripts/gxt-manifest-lib.mjs +139 -0
- package/templates/scripts/gxt-pin-mission.sh +31 -0
- package/templates/scripts/gxt-resolve-mission.sh +47 -0
- package/templates/scripts/gxt-runtime-env.sh +32 -0
- package/templates/scripts/validate-gxt.sh +184 -0
- package/templates/skills/gapman.md +5 -0
- package/templates/skills/logic.md +3 -0
- package/templates/skills/substrate.md +3 -0
- package/templates/skills/ui.md +3 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ForbiddenFileState {
|
|
2
|
+
repoRelPath: string;
|
|
3
|
+
exists: boolean;
|
|
4
|
+
size: number;
|
|
5
|
+
mtimeMs: number;
|
|
6
|
+
sha256: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ForbiddenScanBaseline {
|
|
9
|
+
repoRoot: string;
|
|
10
|
+
files: Record<string, ForbiddenFileState>;
|
|
11
|
+
}
|
|
12
|
+
export interface ForbiddenViolation {
|
|
13
|
+
kind: "added" | "modified" | "deleted";
|
|
14
|
+
path: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function buildForbiddenBaseline(repoRoot: string, forbiddenZones: readonly string[]): ForbiddenScanBaseline;
|
|
17
|
+
export declare function detectForbiddenViolations(baseline: ForbiddenScanBaseline, forbiddenZones: readonly string[]): ForbiddenViolation[];
|
|
18
|
+
//# sourceMappingURL=forbidden-scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-scan.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/forbidden-scan.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd;AAsED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,qBAAqB,CAKvB;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,qBAAqB,EAC/B,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,kBAAkB,EAAE,CA0BtB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import crypto from "node:crypto";
|
|
4
|
+
const MAX_HASH_BYTES = 10 * 1024 * 1024;
|
|
5
|
+
function toRepoRelativePosix(repoRoot, absolutePath) {
|
|
6
|
+
const rel = path.relative(repoRoot, absolutePath);
|
|
7
|
+
return rel.split(path.sep).join("/");
|
|
8
|
+
}
|
|
9
|
+
function hashBuffer(data) {
|
|
10
|
+
return crypto.createHash("sha256").update(data).digest("hex");
|
|
11
|
+
}
|
|
12
|
+
function hashFile(absPath) {
|
|
13
|
+
const stat = fs.statSync(absPath);
|
|
14
|
+
if (stat.size > MAX_HASH_BYTES) {
|
|
15
|
+
// Keep the signal deterministic while avoiding very large file reads in v1.
|
|
16
|
+
return `SKIPPED_SIZE_GT_${String(MAX_HASH_BYTES)}`;
|
|
17
|
+
}
|
|
18
|
+
return hashBuffer(fs.readFileSync(absPath));
|
|
19
|
+
}
|
|
20
|
+
function scanRootRecursive(repoRoot, absRoot, acc) {
|
|
21
|
+
if (!fs.existsSync(absRoot))
|
|
22
|
+
return;
|
|
23
|
+
const stat = fs.statSync(absRoot);
|
|
24
|
+
if (stat.isFile()) {
|
|
25
|
+
const rel = toRepoRelativePosix(repoRoot, absRoot);
|
|
26
|
+
acc[rel] = {
|
|
27
|
+
repoRelPath: rel,
|
|
28
|
+
exists: true,
|
|
29
|
+
size: stat.size,
|
|
30
|
+
mtimeMs: stat.mtimeMs,
|
|
31
|
+
sha256: hashFile(absRoot),
|
|
32
|
+
};
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (!stat.isDirectory())
|
|
36
|
+
return;
|
|
37
|
+
const walk = (dir) => {
|
|
38
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
39
|
+
const child = path.join(dir, entry.name);
|
|
40
|
+
if (entry.isDirectory()) {
|
|
41
|
+
walk(child);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (!entry.isFile())
|
|
45
|
+
continue;
|
|
46
|
+
const childStat = fs.statSync(child);
|
|
47
|
+
const rel = toRepoRelativePosix(repoRoot, child);
|
|
48
|
+
acc[rel] = {
|
|
49
|
+
repoRelPath: rel,
|
|
50
|
+
exists: true,
|
|
51
|
+
size: childStat.size,
|
|
52
|
+
mtimeMs: childStat.mtimeMs,
|
|
53
|
+
sha256: hashFile(child),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
walk(absRoot);
|
|
58
|
+
}
|
|
59
|
+
function snapshotForbiddenFiles(repoRoot, forbiddenZones) {
|
|
60
|
+
const files = {};
|
|
61
|
+
for (const zone of forbiddenZones) {
|
|
62
|
+
const abs = path.resolve(zone);
|
|
63
|
+
scanRootRecursive(repoRoot, abs, files);
|
|
64
|
+
}
|
|
65
|
+
return files;
|
|
66
|
+
}
|
|
67
|
+
export function buildForbiddenBaseline(repoRoot, forbiddenZones) {
|
|
68
|
+
return {
|
|
69
|
+
repoRoot,
|
|
70
|
+
files: snapshotForbiddenFiles(repoRoot, forbiddenZones),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export function detectForbiddenViolations(baseline, forbiddenZones) {
|
|
74
|
+
const current = snapshotForbiddenFiles(baseline.repoRoot, forbiddenZones);
|
|
75
|
+
const violations = [];
|
|
76
|
+
const baseKeys = new Set(Object.keys(baseline.files));
|
|
77
|
+
const currentKeys = new Set(Object.keys(current));
|
|
78
|
+
for (const key of currentKeys) {
|
|
79
|
+
if (!baseKeys.has(key)) {
|
|
80
|
+
violations.push({ kind: "added", path: key });
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const a = baseline.files[key];
|
|
84
|
+
const b = current[key];
|
|
85
|
+
if (a.sha256 !== b.sha256 || a.size !== b.size || a.mtimeMs !== b.mtimeMs) {
|
|
86
|
+
violations.push({ kind: "modified", path: key });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
for (const key of baseKeys) {
|
|
90
|
+
if (!currentKeys.has(key)) {
|
|
91
|
+
violations.push({ kind: "deleted", path: key });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return violations.sort((x, y) => x.path.localeCompare(y.path));
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=forbidden-scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-scan.js","sourceRoot":"","sources":["../../../src/cli/lib/forbidden-scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AAoBjC,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAExC,SAAS,mBAAmB,CAAC,QAAgB,EAAE,YAAoB;IACjE,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAClD,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,QAAQ,CAAC,OAAe;IAC/B,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,IAAI,CAAC,IAAI,GAAG,cAAc,EAAE,CAAC;QAC/B,4EAA4E;QAC5E,OAAO,mBAAmB,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;IACrD,CAAC;IACD,OAAO,UAAU,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;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AAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;YAC9C,SAAS;QACX,CAAC;QACD,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAE,CAAC;QACxB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;YAC1E,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GateSpec } from "./types.js";
|
|
2
|
+
export interface GateRunResult {
|
|
3
|
+
exitCode: number | null;
|
|
4
|
+
stdout: string;
|
|
5
|
+
stderr: string;
|
|
6
|
+
combined: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function runGate(workingDirectory: string, spec: GateSpec): GateRunResult;
|
|
9
|
+
export declare function gatePassed(result: GateRunResult, successSubstring: string | null): boolean;
|
|
10
|
+
//# sourceMappingURL=gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/gate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,wBAAgB,OAAO,CAAC,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,aAAa,CAgB/E;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAI1F"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
const MAX_IO_BUFFER_BYTES = 20 * 1024 * 1024;
|
|
3
|
+
function shellForPlatform() {
|
|
4
|
+
return process.platform === "win32" ? true : "/bin/sh";
|
|
5
|
+
}
|
|
6
|
+
export function runGate(workingDirectory, spec) {
|
|
7
|
+
const proc = spawnSync(spec.command, {
|
|
8
|
+
cwd: workingDirectory,
|
|
9
|
+
shell: shellForPlatform(),
|
|
10
|
+
encoding: "utf8",
|
|
11
|
+
maxBuffer: MAX_IO_BUFFER_BYTES,
|
|
12
|
+
env: process.env,
|
|
13
|
+
});
|
|
14
|
+
const stdout = proc.stdout ?? "";
|
|
15
|
+
const stderr = proc.stderr ?? "";
|
|
16
|
+
return {
|
|
17
|
+
exitCode: proc.status,
|
|
18
|
+
stdout,
|
|
19
|
+
stderr,
|
|
20
|
+
combined: `${stdout}\n${stderr}`,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function gatePassed(result, successSubstring) {
|
|
24
|
+
if (result.exitCode !== 0)
|
|
25
|
+
return false;
|
|
26
|
+
if (successSubstring && !result.combined.includes(successSubstring))
|
|
27
|
+
return false;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../../../src/cli/lib/gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,MAAM,mBAAmB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAS7C,SAAS,gBAAgB;IACvB,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,gBAAwB,EAAE,IAAc;IAC9D,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE;QACnC,GAAG,EAAE,gBAAgB;QACrB,KAAK,EAAE,gBAAgB,EAAE;QACzB,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,mBAAmB;QAC9B,GAAG,EAAE,OAAO,CAAC,GAAG;KACjB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;IACjC,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,MAAM;QACrB,MAAM;QACN,MAAM;QACN,QAAQ,EAAE,GAAG,MAAM,KAAK,MAAM,EAAE;KACjC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAAqB,EAAE,gBAA+B;IAC/E,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,IAAI,gBAAgB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAAE,OAAO,KAAK,CAAC;IAClF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-metrics-missions.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/git-metrics-missions.ts"],"names":[],"mappings":"AAiBA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO7D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAmB7E"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import YAML from "yaml";
|
|
2
|
+
import { MSN_ID_PATTERN } from "./constants.js";
|
|
3
|
+
import { gitRunOk } from "./git-repo.js";
|
|
4
|
+
const MISSIONS_PREFIX = ".gitagent/missions/";
|
|
5
|
+
function parseMsnFromYamlContent(content) {
|
|
6
|
+
try {
|
|
7
|
+
const data = YAML.parse(content);
|
|
8
|
+
const raw = data.msn_id ?? data.msnId;
|
|
9
|
+
if (typeof raw === "string" && MSN_ID_PATTERN.test(raw.trim()))
|
|
10
|
+
return raw.trim();
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
/* skip */
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
export function msnFromMissionPath(rel) {
|
|
18
|
+
const norm = rel.trim().replace(/\\/g, "/");
|
|
19
|
+
if (!norm.startsWith(MISSIONS_PREFIX))
|
|
20
|
+
return null;
|
|
21
|
+
if (!/\.(ya?ml|md)$/i.test(norm))
|
|
22
|
+
return null;
|
|
23
|
+
const fromName = norm.match(/MSN-\d{4}/)?.[0];
|
|
24
|
+
if (fromName && MSN_ID_PATTERN.test(fromName))
|
|
25
|
+
return fromName;
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
export function listMissionMsnIdsAtRef(root, ref) {
|
|
29
|
+
const ids = new Set();
|
|
30
|
+
const tree = gitRunOk(root, ["ls-tree", "-r", "--name-only", ref, MISSIONS_PREFIX]);
|
|
31
|
+
if (!tree.ok)
|
|
32
|
+
return ids;
|
|
33
|
+
for (const rel of tree.stdout.split("\n")) {
|
|
34
|
+
const norm = rel.trim().replace(/\\/g, "/");
|
|
35
|
+
if (!norm)
|
|
36
|
+
continue;
|
|
37
|
+
const fromName = msnFromMissionPath(norm);
|
|
38
|
+
if (fromName) {
|
|
39
|
+
ids.add(fromName);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const show = gitRunOk(root, ["show", `${ref}:${norm}`]);
|
|
43
|
+
if (!show.ok)
|
|
44
|
+
continue;
|
|
45
|
+
const parsed = parseMsnFromYamlContent(show.stdout);
|
|
46
|
+
if (parsed)
|
|
47
|
+
ids.add(parsed);
|
|
48
|
+
}
|
|
49
|
+
return ids;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=git-metrics-missions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-metrics-missions.js","sourceRoot":"","sources":["../../../src/cli/lib/git-metrics-missions.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAE9C,SAAS,uBAAuB,CAAC,OAAe;IAC9C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAwC,CAAC;QACxE,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC;QACtC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAAE,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;IACpF,CAAC;IAAC,MAAM,CAAC;QACP,UAAU;IACZ,CAAC;IACD,OAAO,IAAI,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,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,CAAC,EAAE;YAAE,SAAS;QACvB,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,MAAM;YAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface LogRecord {
|
|
2
|
+
hash: string;
|
|
3
|
+
subject: string;
|
|
4
|
+
email: string;
|
|
5
|
+
ts: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function streamLogRecords(root: string, ref: string): LogRecord[];
|
|
8
|
+
export declare function countBypassNotes(root: string): number;
|
|
9
|
+
export declare function median(values: number[]): number | null;
|
|
10
|
+
export declare function clearMetricsDiffCache(): void;
|
|
11
|
+
export declare function aggregateFromLogStream(root: string, records: LogRecord[]): {
|
|
12
|
+
missionIdsFromLog: Set<string>;
|
|
13
|
+
legislative: number;
|
|
14
|
+
worker_trace: number;
|
|
15
|
+
bypass_audit: number;
|
|
16
|
+
firstSeen: Map<string, number>;
|
|
17
|
+
lastSeen: Map<string, number>;
|
|
18
|
+
};
|
|
19
|
+
export declare function computeTurnaround(firstSeen: Map<string, number>, lastSeen: Map<string, number>): {
|
|
20
|
+
mean: number | null;
|
|
21
|
+
median: number | null;
|
|
22
|
+
samples: number;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=git-metrics-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-metrics-stream.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/git-metrics-stream.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ;AAID,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,CAiBvE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIrD;AA4BD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAWtD;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,EAAE,GACnB;IACD,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAuDA;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC5B;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAWjE"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { GXT_BYPASS_NOTES_REF } from "./break-glass.js";
|
|
2
|
+
import { MSN_ID_PATTERN, WORKER_LOG_FILENAME } from "./constants.js";
|
|
3
|
+
import { parseTeacherEmailsFromEnv, commitSubjectHasMsnPrefix } from "./git-proof.js";
|
|
4
|
+
import { gitRunOk } from "./git-repo.js";
|
|
5
|
+
import { msnFromMissionPath } from "./git-metrics-missions.js";
|
|
6
|
+
const diffCache = new Map();
|
|
7
|
+
export function streamLogRecords(root, ref) {
|
|
8
|
+
const r = gitRunOk(root, ["log", ref, "-z", "--reverse", "--format=%H%x1f%s%x1f%aE%x1f%cI"], 64 * 1024 * 1024);
|
|
9
|
+
if (!r.ok || !r.stdout.trim())
|
|
10
|
+
return [];
|
|
11
|
+
const records = [];
|
|
12
|
+
for (const chunk of r.stdout.split("\0").filter((c) => c.length > 0)) {
|
|
13
|
+
const parts = chunk.split("\x1f");
|
|
14
|
+
if (parts.length < 4)
|
|
15
|
+
continue;
|
|
16
|
+
const [hash, subject, email, ts] = parts;
|
|
17
|
+
if (!hash || !subject || !email || !ts)
|
|
18
|
+
continue;
|
|
19
|
+
records.push({ hash, subject, email, ts });
|
|
20
|
+
}
|
|
21
|
+
return records;
|
|
22
|
+
}
|
|
23
|
+
export function countBypassNotes(root) {
|
|
24
|
+
const r = gitRunOk(root, ["notes", `--ref=${GXT_BYPASS_NOTES_REF}`, "list"]);
|
|
25
|
+
if (!r.ok || !r.stdout.trim())
|
|
26
|
+
return 0;
|
|
27
|
+
return r.stdout.split("\n").filter((l) => l.trim().length > 0).length;
|
|
28
|
+
}
|
|
29
|
+
function commitChangedPaths(root, hash) {
|
|
30
|
+
const cached = diffCache.get(hash);
|
|
31
|
+
if (cached)
|
|
32
|
+
return cached;
|
|
33
|
+
const r = gitRunOk(root, ["diff-tree", "--no-commit-id", "--name-only", "-r", hash]);
|
|
34
|
+
const paths = r.ok
|
|
35
|
+
? r.stdout
|
|
36
|
+
.split("\n")
|
|
37
|
+
.map((p) => p.trim().replace(/\\/g, "/"))
|
|
38
|
+
.filter((p) => p.length > 0)
|
|
39
|
+
: [];
|
|
40
|
+
diffCache.set(hash, paths);
|
|
41
|
+
return paths;
|
|
42
|
+
}
|
|
43
|
+
function isTeacherEmail(email) {
|
|
44
|
+
const allow = parseTeacherEmailsFromEnv();
|
|
45
|
+
if (allow.length === 0)
|
|
46
|
+
return false;
|
|
47
|
+
return allow.includes(email.trim().toLowerCase());
|
|
48
|
+
}
|
|
49
|
+
function subjectMsnId(subject) {
|
|
50
|
+
const m = subject.trim().match(/^\[(MSN-\d{4})\]/);
|
|
51
|
+
const id = m?.[1];
|
|
52
|
+
return id && MSN_ID_PATTERN.test(id) ? id : null;
|
|
53
|
+
}
|
|
54
|
+
export function median(values) {
|
|
55
|
+
if (values.length === 0)
|
|
56
|
+
return null;
|
|
57
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
58
|
+
const mid = Math.floor(sorted.length / 2);
|
|
59
|
+
if (sorted.length % 2 === 0) {
|
|
60
|
+
const a = sorted[mid - 1];
|
|
61
|
+
const b = sorted[mid];
|
|
62
|
+
if (a === undefined || b === undefined)
|
|
63
|
+
return null;
|
|
64
|
+
return (a + b) / 2;
|
|
65
|
+
}
|
|
66
|
+
return sorted[mid] ?? null;
|
|
67
|
+
}
|
|
68
|
+
export function clearMetricsDiffCache() {
|
|
69
|
+
diffCache.clear();
|
|
70
|
+
}
|
|
71
|
+
export function aggregateFromLogStream(root, records) {
|
|
72
|
+
const missionIdsFromLog = new Set();
|
|
73
|
+
let legislative = 0;
|
|
74
|
+
let worker_trace = 0;
|
|
75
|
+
let bypass_audit = 0;
|
|
76
|
+
const firstSeen = new Map();
|
|
77
|
+
const lastSeen = new Map();
|
|
78
|
+
for (const rec of records) {
|
|
79
|
+
const ts = Date.parse(rec.ts);
|
|
80
|
+
if (!Number.isFinite(ts))
|
|
81
|
+
continue;
|
|
82
|
+
if (rec.subject.trim().startsWith("[GXT-AUDIT] break-glass:")) {
|
|
83
|
+
bypass_audit++;
|
|
84
|
+
}
|
|
85
|
+
const msnFromSubject = subjectMsnId(rec.subject);
|
|
86
|
+
if (msnFromSubject)
|
|
87
|
+
missionIdsFromLog.add(msnFromSubject);
|
|
88
|
+
const paths = commitChangedPaths(root, rec.hash);
|
|
89
|
+
let touchesMission = false;
|
|
90
|
+
let touchesWorkerLog = false;
|
|
91
|
+
for (const p of paths) {
|
|
92
|
+
if (p === WORKER_LOG_FILENAME)
|
|
93
|
+
touchesWorkerLog = true;
|
|
94
|
+
const msnFromPath = msnFromMissionPath(p);
|
|
95
|
+
if (msnFromPath) {
|
|
96
|
+
touchesMission = true;
|
|
97
|
+
if (!firstSeen.has(msnFromPath))
|
|
98
|
+
firstSeen.set(msnFromPath, ts);
|
|
99
|
+
missionIdsFromLog.add(msnFromPath);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (msnFromSubject &&
|
|
103
|
+
commitSubjectHasMsnPrefix(rec.subject, msnFromSubject) &&
|
|
104
|
+
isTeacherEmail(rec.email) &&
|
|
105
|
+
touchesMission) {
|
|
106
|
+
legislative++;
|
|
107
|
+
}
|
|
108
|
+
if (touchesWorkerLog && !touchesMission)
|
|
109
|
+
worker_trace++;
|
|
110
|
+
if (msnFromSubject)
|
|
111
|
+
lastSeen.set(msnFromSubject, ts);
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
missionIdsFromLog,
|
|
115
|
+
legislative,
|
|
116
|
+
worker_trace,
|
|
117
|
+
bypass_audit,
|
|
118
|
+
firstSeen,
|
|
119
|
+
lastSeen,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export function computeTurnaround(firstSeen, lastSeen) {
|
|
123
|
+
const deltas = [];
|
|
124
|
+
for (const [msn, end] of lastSeen) {
|
|
125
|
+
const start = firstSeen.get(msn);
|
|
126
|
+
if (start === undefined)
|
|
127
|
+
continue;
|
|
128
|
+
const delta = (end - start) / 1000;
|
|
129
|
+
if (Number.isFinite(delta) && delta >= 0)
|
|
130
|
+
deltas.push(delta);
|
|
131
|
+
}
|
|
132
|
+
if (deltas.length === 0)
|
|
133
|
+
return { mean: null, median: null, samples: 0 };
|
|
134
|
+
const sum = deltas.reduce((a, b) => a + b, 0);
|
|
135
|
+
return { mean: sum / deltas.length, median: median(deltas), samples: deltas.length };
|
|
136
|
+
}
|
|
137
|
+
//# sourceM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,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACzE,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,OAAO,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AACvF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface GitMetricsReport {
|
|
2
|
+
ref: string;
|
|
3
|
+
missions_completed: number;
|
|
4
|
+
bypass_count: number;
|
|
5
|
+
bypass_audit_commits: number;
|
|
6
|
+
legislative_commits: number;
|
|
7
|
+
worker_trace_commits: number;
|
|
8
|
+
turnaround_seconds: {
|
|
9
|
+
mean: number | null;
|
|
10
|
+
median: number | null;
|
|
11
|
+
samples: number;
|
|
12
|
+
};
|
|
13
|
+
mission_ids: string[];
|
|
14
|
+
}
|
|
15
|
+
/** Stable key order for cross-clone identical JSON. */
|
|
16
|
+
export declare function collectGitMetrics(root: string, refName: string): GitMetricsReport;
|
|
17
|
+
export declare function formatGitMetricsHuman(report: GitMetricsReport): string;
|
|
18
|
+
//# sourceMappingURL=git-metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-metrics.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/git-metrics.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE;QAClB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAmBjF;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAatE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { gitRevParse } from "./git-repo.js";
|
|
2
|
+
import { listMissionMsnIdsAtRef } from "./git-metrics-missions.js";
|
|
3
|
+
import { aggregateFromLogStream, clearMetricsDiffCache, computeTurnaround, countBypassNotes, streamLogRecords, } from "./git-metrics-stream.js";
|
|
4
|
+
/** Stable key order for cross-clone identical JSON. */
|
|
5
|
+
export function collectGitMetrics(root, refName) {
|
|
6
|
+
clearMetricsDiffCache();
|
|
7
|
+
const ref = gitRevParse(root, refName);
|
|
8
|
+
if (!ref)
|
|
9
|
+
throw new Error(`gapman metrics: invalid ref ${refName}`);
|
|
10
|
+
const records = streamLogRecords(root, ref);
|
|
11
|
+
const stream = aggregateFromLogStream(root, records);
|
|
12
|
+
const fromMissions = listMissionMsnIdsAtRef(root, ref);
|
|
13
|
+
const missionIds = [...new Set([...fromMissions, ...stream.missionIdsFromLog])].sort();
|
|
14
|
+
return {
|
|
15
|
+
ref,
|
|
16
|
+
missions_completed: missionIds.length,
|
|
17
|
+
bypass_count: countBypassNotes(root),
|
|
18
|
+
bypass_audit_commits: stream.bypass_audit,
|
|
19
|
+
legislative_commits: stream.legislative,
|
|
20
|
+
worker_trace_commits: stream.worker_trace,
|
|
21
|
+
turnaround_seconds: computeTurnaround(stream.firstSeen, stream.lastSeen),
|
|
22
|
+
mission_ids: missionIds,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function formatGitMetricsHuman(report) {
|
|
26
|
+
const lines = [
|
|
27
|
+
`GXT metrics (ref ${report.ref})`,
|
|
28
|
+
` missions_completed: ${String(report.missions_completed)}`,
|
|
29
|
+
` bypass_count (git notes): ${String(report.bypass_count)}`,
|
|
30
|
+
` bypass_audit_commits: ${String(report.bypass_audit_commits)}`,
|
|
31
|
+
` legislative_commits (proxy): ${String(report.legislative_commits)}`,
|
|
32
|
+
` worker_trace_commits (proxy): ${String(report.worker_trace_commits)}`,
|
|
33
|
+
` turnaround_seconds.mean: ${report.turnaround_seconds.mean === null ? "n/a" : report.turnaround_seconds.mean.toFixed(1)}`,
|
|
34
|
+
` turnaround_seconds.median: ${report.turnaround_seconds.median === null ? "n/a" : report.turnaround_seconds.median.toFixed(1)}`,
|
|
35
|
+
` turnaround_seconds.samples: ${String(report.turnaround_seconds.samples)}`,
|
|
36
|
+
];
|
|
37
|
+
return lines.join("\n");
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=git-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-metrics.js","sourceRoot":"","sources":["../../../src/cli/lib/git-metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAiBjC,uDAAuD;AACvD,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,OAAe;IAC7D,qBAAqB,EAAE,CAAC;IACxB,MAAM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B,CAAC,EAAE;QACxE,8BAA8B,MAAM,CAAC,kBAAkB,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAC3H,gCAAgC,MAAM,CAAC,kBAAkB,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACjI,iCAAiC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE;KAC7E,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-proof-errors.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/git-proof-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,GAAE,mBAAwB,GAC5B,KAAK,CAMP"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CLI_NAME } from "./constants.js";
|
|
2
|
+
import { hintGitProof } from "./fix-hints.js";
|
|
3
|
+
import { GapmanUserError } from "./user-error.js";
|
|
4
|
+
export function throwGitProofError(code, detail, ctx = {}) {
|
|
5
|
+
throw new GapmanUserError(code, `${CLI_NAME} verify: git-proof: ${code} — ${detail}`, hintGitProof(code, ctx));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=git-proof-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-proof-errors.js","sourceRoot":"","sources":["../../../src/cli/lib/git-proof-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAA4B,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,UAAU,kBAAkB,CAChC,IAAY,EACZ,MAAc,EACd,MAA2B,EAAE;IAE7B,MAAM,IAAI,eAAe,CACvB,IAAI,EACJ,GAAG,QAAQ,uBAAuB,IAAI,MAAM,MAAM,EAAE,EACpD,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CACxB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Missions verified by `gapman verify` must live under this repo-relative prefix. */
|
|
2
|
+
export declare const REL_MISSIONS_PREFIX: ".gitagent/missions/";
|
|
3
|
+
export { ENV_TEACHER_EMAILS, parseTeacherEmailsFromEnv } from "./teacher-identity.js";
|
|
4
|
+
export declare function missionPathRepoRelative(root: string, missionAbsolutePath: string): string;
|
|
5
|
+
export declare function assertMissionUnderMissionsDir(repoRelMissionPath: string): void;
|
|
6
|
+
export interface MsnCommitRow {
|
|
7
|
+
hash: string;
|
|
8
|
+
subject: string;
|
|
9
|
+
authorEmail: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* True iff the commit **subject line** (`git log` %s) begins with `[msnId]` as legislation.
|
|
13
|
+
* Does not inspect the commit body — avoids matching `[MSN-…]` that appears only in the body.
|
|
14
|
+
*/
|
|
15
|
+
export declare function commitSubjectHasMsnPrefix(subject: string, msnId: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Newest-first commits among the last `scanDepth` history entries whose **subject** (%s) starts
|
|
18
|
+
* with `[msnId]`. Uses plain `git log` (no `--grep`) so matches cannot come from the body alone.
|
|
19
|
+
*/
|
|
20
|
+
export declare function listMsnSubjectCommits(root: string, msnId: string, scanDepth?: number): MsnCommitRow[];
|
|
21
|
+
/** Paths changed in commit `hash` (repo-relative forward slashes). */
|
|
22
|
+
export declare function listCommitChangedPaths(root: string, hash: string): string[];
|
|
23
|
+
export interface TeacherMissionProofOptions {
|
|
24
|
+
/** Max commits to scan in `git log` (default 200). */
|
|
25
|
+
scanDepth?: number;
|
|
26
|
+
/** When set, must match parser-resolved mission MSN (avoids re-resolving identity from disk). */
|
|
27
|
+
msnId?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Forensic gate (v0.6.2): MSN is read from the mission file; the most recent
|
|
31
|
+
* Teacher-authored commit whose subject starts with `[MSN-XXXX]` must modify
|
|
32
|
+
* that mission path. Returns the resolved MSN id.
|
|
33
|
+
*/
|
|
34
|
+
export declare function assertTeacherMissionProof(root: string, missionAbsolutePath: string, options?: TeacherMissionProofOptions): string;
|
|
35
|
+
/** Non-throwing git-proof check for onboarding/tutorial flows. */
|
|
36
|
+
export declare function teacherMissionStamped(root: string, missionAbsolutePath: string, options?: TeacherMissionProofOptions): boolean;
|
|
37
|
+
//# sourceMappingURL=git-proof.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-proof.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/git-proof.ts"],"names":[],"mappings":"AAOA,sFAAsF;AACtF,eAAO,MAAM,mBAAmB,EAAG,qBAA8B,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAItF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAUzF;AAED,wBAAgB,6BAA6B,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAS9E;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EA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