@codeledger/cli 0.10.5 → 0.10.6
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 +61 -0
- package/README.md +97 -0
- package/bin/codeledger.js +66 -0
- package/package.json +32 -46
- package/scripts/postinstall.js +285 -0
- package/bin/codeledger-open.cjs +0 -89
- package/bin/codeledger-standalone.cjs +0 -3964
- package/dist/ambient-activation.d.ts +0 -30
- package/dist/ambient-activation.d.ts.map +0 -1
- package/dist/ambient-activation.js +0 -449
- package/dist/ambient-activation.js.map +0 -1
- package/dist/arch-policy/resolve.d.ts +0 -11
- package/dist/arch-policy/resolve.d.ts.map +0 -1
- package/dist/arch-policy/resolve.js +0 -195
- package/dist/arch-policy/resolve.js.map +0 -1
- package/dist/arch-policy/simulate.d.ts +0 -9
- package/dist/arch-policy/simulate.d.ts.map +0 -1
- package/dist/arch-policy/simulate.js +0 -175
- package/dist/arch-policy/simulate.js.map +0 -1
- package/dist/architecture-graph/dependency-scanner.d.ts +0 -16
- package/dist/architecture-graph/dependency-scanner.d.ts.map +0 -1
- package/dist/architecture-graph/dependency-scanner.js +0 -96
- package/dist/architecture-graph/dependency-scanner.js.map +0 -1
- package/dist/architecture-graph/graph-builder.d.ts +0 -70
- package/dist/architecture-graph/graph-builder.d.ts.map +0 -1
- package/dist/architecture-graph/graph-builder.js +0 -231
- package/dist/architecture-graph/graph-builder.js.map +0 -1
- package/dist/architecture-graph/index.d.ts +0 -4
- package/dist/architecture-graph/index.d.ts.map +0 -1
- package/dist/architecture-graph/index.js +0 -7
- package/dist/architecture-graph/index.js.map +0 -1
- package/dist/architecture-graph/service-scanner.d.ts +0 -22
- package/dist/architecture-graph/service-scanner.d.ts.map +0 -1
- package/dist/architecture-graph/service-scanner.js +0 -181
- package/dist/architecture-graph/service-scanner.js.map +0 -1
- package/dist/artifacts/summary.d.ts +0 -6
- package/dist/artifacts/summary.d.ts.map +0 -1
- package/dist/artifacts/summary.js +0 -49
- package/dist/artifacts/summary.js.map +0 -1
- package/dist/command-activation.d.ts +0 -3
- package/dist/command-activation.d.ts.map +0 -1
- package/dist/command-activation.js +0 -2
- package/dist/command-activation.js.map +0 -1
- package/dist/commands/about.d.ts +0 -2
- package/dist/commands/about.d.ts.map +0 -1
- package/dist/commands/about.js +0 -18
- package/dist/commands/about.js.map +0 -1
- package/dist/commands/activate.d.ts +0 -18
- package/dist/commands/activate.d.ts.map +0 -1
- package/dist/commands/activate.js +0 -1110
- package/dist/commands/activate.js.map +0 -1
- package/dist/commands/apply-policy.d.ts +0 -7
- package/dist/commands/apply-policy.d.ts.map +0 -1
- package/dist/commands/apply-policy.js +0 -62
- package/dist/commands/apply-policy.js.map +0 -1
- package/dist/commands/arch-policy.d.ts +0 -8
- package/dist/commands/arch-policy.d.ts.map +0 -1
- package/dist/commands/arch-policy.js +0 -349
- package/dist/commands/arch-policy.js.map +0 -1
- package/dist/commands/audit-export.d.ts +0 -8
- package/dist/commands/audit-export.d.ts.map +0 -1
- package/dist/commands/audit-export.js +0 -192
- package/dist/commands/audit-export.js.map +0 -1
- package/dist/commands/audit.d.ts +0 -24
- package/dist/commands/audit.d.ts.map +0 -1
- package/dist/commands/audit.js +0 -1138
- package/dist/commands/audit.js.map +0 -1
- package/dist/commands/auto-refresh.d.ts +0 -17
- package/dist/commands/auto-refresh.d.ts.map +0 -1
- package/dist/commands/auto-refresh.js +0 -152
- package/dist/commands/auto-refresh.js.map +0 -1
- package/dist/commands/broker.d.ts +0 -22
- package/dist/commands/broker.d.ts.map +0 -1
- package/dist/commands/broker.js +0 -487
- package/dist/commands/broker.js.map +0 -1
- package/dist/commands/bundle.d.ts +0 -2
- package/dist/commands/bundle.d.ts.map +0 -1
- package/dist/commands/bundle.js +0 -230
- package/dist/commands/bundle.js.map +0 -1
- package/dist/commands/capsule-change.d.ts +0 -7
- package/dist/commands/capsule-change.d.ts.map +0 -1
- package/dist/commands/capsule-change.js +0 -177
- package/dist/commands/capsule-change.js.map +0 -1
- package/dist/commands/checkpoint.d.ts +0 -26
- package/dist/commands/checkpoint.d.ts.map +0 -1
- package/dist/commands/checkpoint.js +0 -382
- package/dist/commands/checkpoint.js.map +0 -1
- package/dist/commands/ci.d.ts +0 -16
- package/dist/commands/ci.d.ts.map +0 -1
- package/dist/commands/ci.js +0 -287
- package/dist/commands/ci.js.map +0 -1
- package/dist/commands/claims.d.ts +0 -14
- package/dist/commands/claims.d.ts.map +0 -1
- package/dist/commands/claims.js +0 -93
- package/dist/commands/claims.js.map +0 -1
- package/dist/commands/claude.d.ts +0 -2
- package/dist/commands/claude.d.ts.map +0 -1
- package/dist/commands/claude.js +0 -5
- package/dist/commands/claude.js.map +0 -1
- package/dist/commands/clean.d.ts +0 -2
- package/dist/commands/clean.d.ts.map +0 -1
- package/dist/commands/clean.js +0 -28
- package/dist/commands/clean.js.map +0 -1
- package/dist/commands/coach.d.ts +0 -11
- package/dist/commands/coach.d.ts.map +0 -1
- package/dist/commands/coach.js +0 -169
- package/dist/commands/coach.js.map +0 -1
- package/dist/commands/codex.d.ts +0 -2
- package/dist/commands/codex.d.ts.map +0 -1
- package/dist/commands/codex.js +0 -5
- package/dist/commands/codex.js.map +0 -1
- package/dist/commands/commit-msg.d.ts +0 -58
- package/dist/commands/commit-msg.d.ts.map +0 -1
- package/dist/commands/commit-msg.js +0 -461
- package/dist/commands/commit-msg.js.map +0 -1
- package/dist/commands/compare-current.d.ts +0 -2
- package/dist/commands/compare-current.d.ts.map +0 -1
- package/dist/commands/compare-current.js +0 -186
- package/dist/commands/compare-current.js.map +0 -1
- package/dist/commands/compare.d.ts +0 -2
- package/dist/commands/compare.d.ts.map +0 -1
- package/dist/commands/compare.js +0 -253
- package/dist/commands/compare.js.map +0 -1
- package/dist/commands/complete-check.d.ts +0 -24
- package/dist/commands/complete-check.d.ts.map +0 -1
- package/dist/commands/complete-check.js +0 -287
- package/dist/commands/complete-check.js.map +0 -1
- package/dist/commands/conflicts.d.ts +0 -12
- package/dist/commands/conflicts.d.ts.map +0 -1
- package/dist/commands/conflicts.js +0 -55
- package/dist/commands/conflicts.js.map +0 -1
- package/dist/commands/context-handoff.d.ts +0 -2
- package/dist/commands/context-handoff.d.ts.map +0 -1
- package/dist/commands/context-handoff.js +0 -58
- package/dist/commands/context-handoff.js.map +0 -1
- package/dist/commands/context.d.ts +0 -22
- package/dist/commands/context.d.ts.map +0 -1
- package/dist/commands/context.js +0 -836
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/coordination.d.ts +0 -6
- package/dist/commands/coordination.d.ts.map +0 -1
- package/dist/commands/coordination.js +0 -177
- package/dist/commands/coordination.js.map +0 -1
- package/dist/commands/cowork-refresh.d.ts +0 -8
- package/dist/commands/cowork-refresh.d.ts.map +0 -1
- package/dist/commands/cowork-refresh.js +0 -50
- package/dist/commands/cowork-refresh.js.map +0 -1
- package/dist/commands/cowork-snapshot.d.ts +0 -8
- package/dist/commands/cowork-snapshot.d.ts.map +0 -1
- package/dist/commands/cowork-snapshot.js +0 -34
- package/dist/commands/cowork-snapshot.js.map +0 -1
- package/dist/commands/cowork-start.d.ts +0 -8
- package/dist/commands/cowork-start.d.ts.map +0 -1
- package/dist/commands/cowork-start.js +0 -71
- package/dist/commands/cowork-start.js.map +0 -1
- package/dist/commands/cowork-stop.d.ts +0 -7
- package/dist/commands/cowork-stop.d.ts.map +0 -1
- package/dist/commands/cowork-stop.js +0 -43
- package/dist/commands/cowork-stop.js.map +0 -1
- package/dist/commands/daemon.d.ts +0 -2
- package/dist/commands/daemon.d.ts.map +0 -1
- package/dist/commands/daemon.js +0 -5
- package/dist/commands/daemon.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -18
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/dashboard.js +0 -481
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/detect-secrets.d.ts +0 -19
- package/dist/commands/detect-secrets.d.ts.map +0 -1
- package/dist/commands/detect-secrets.js +0 -210
- package/dist/commands/detect-secrets.js.map +0 -1
- package/dist/commands/discover-check.d.ts +0 -19
- package/dist/commands/discover-check.d.ts.map +0 -1
- package/dist/commands/discover-check.js +0 -256
- package/dist/commands/discover-check.js.map +0 -1
- package/dist/commands/discover-gate.d.ts +0 -20
- package/dist/commands/discover-gate.d.ts.map +0 -1
- package/dist/commands/discover-gate.js +0 -131
- package/dist/commands/discover-gate.js.map +0 -1
- package/dist/commands/discover.d.ts +0 -14
- package/dist/commands/discover.d.ts.map +0 -1
- package/dist/commands/discover.js +0 -132
- package/dist/commands/discover.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -9
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -277
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/drift.d.ts +0 -2
- package/dist/commands/drift.d.ts.map +0 -1
- package/dist/commands/drift.js +0 -171
- package/dist/commands/drift.js.map +0 -1
- package/dist/commands/ecl.d.ts +0 -11
- package/dist/commands/ecl.d.ts.map +0 -1
- package/dist/commands/ecl.js +0 -109
- package/dist/commands/ecl.js.map +0 -1
- package/dist/commands/enable.d.ts +0 -7
- package/dist/commands/enable.d.ts.map +0 -1
- package/dist/commands/enable.js +0 -75
- package/dist/commands/enable.js.map +0 -1
- package/dist/commands/evidence.d.ts +0 -2
- package/dist/commands/evidence.d.ts.map +0 -1
- package/dist/commands/evidence.js +0 -53
- package/dist/commands/evidence.js.map +0 -1
- package/dist/commands/features.d.ts +0 -2
- package/dist/commands/features.d.ts.map +0 -1
- package/dist/commands/features.js +0 -185
- package/dist/commands/features.js.map +0 -1
- package/dist/commands/fix.d.ts +0 -7
- package/dist/commands/fix.d.ts.map +0 -1
- package/dist/commands/fix.js +0 -107
- package/dist/commands/fix.js.map +0 -1
- package/dist/commands/fleet.d.ts +0 -17
- package/dist/commands/fleet.d.ts.map +0 -1
- package/dist/commands/fleet.js +0 -682
- package/dist/commands/fleet.js.map +0 -1
- package/dist/commands/graph.d.ts +0 -18
- package/dist/commands/graph.d.ts.map +0 -1
- package/dist/commands/graph.js +0 -370
- package/dist/commands/graph.js.map +0 -1
- package/dist/commands/guardrails.d.ts +0 -11
- package/dist/commands/guardrails.d.ts.map +0 -1
- package/dist/commands/guardrails.js +0 -112
- package/dist/commands/guardrails.js.map +0 -1
- package/dist/commands/harvest.d.ts +0 -2
- package/dist/commands/harvest.d.ts.map +0 -1
- package/dist/commands/harvest.js +0 -136
- package/dist/commands/harvest.js.map +0 -1
- package/dist/commands/health.d.ts +0 -8
- package/dist/commands/health.d.ts.map +0 -1
- package/dist/commands/health.js +0 -101
- package/dist/commands/health.js.map +0 -1
- package/dist/commands/hotspots.d.ts +0 -2
- package/dist/commands/hotspots.d.ts.map +0 -1
- package/dist/commands/hotspots.js +0 -20
- package/dist/commands/hotspots.js.map +0 -1
- package/dist/commands/init.d.ts +0 -12
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -423
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/insight-seed.d.ts +0 -2
- package/dist/commands/insight-seed.d.ts.map +0 -1
- package/dist/commands/insight-seed.js +0 -59
- package/dist/commands/insight-seed.js.map +0 -1
- package/dist/commands/insight-smoke-test.d.ts +0 -2
- package/dist/commands/insight-smoke-test.d.ts.map +0 -1
- package/dist/commands/insight-smoke-test.js +0 -44
- package/dist/commands/insight-smoke-test.js.map +0 -1
- package/dist/commands/insight.d.ts +0 -2
- package/dist/commands/insight.d.ts.map +0 -1
- package/dist/commands/insight.js +0 -183
- package/dist/commands/insight.js.map +0 -1
- package/dist/commands/intent.d.ts +0 -39
- package/dist/commands/intent.d.ts.map +0 -1
- package/dist/commands/intent.js +0 -539
- package/dist/commands/intent.js.map +0 -1
- package/dist/commands/intervene.d.ts +0 -11
- package/dist/commands/intervene.d.ts.map +0 -1
- package/dist/commands/intervene.js +0 -94
- package/dist/commands/intervene.js.map +0 -1
- package/dist/commands/interventions.d.ts +0 -8
- package/dist/commands/interventions.d.ts.map +0 -1
- package/dist/commands/interventions.js +0 -69
- package/dist/commands/interventions.js.map +0 -1
- package/dist/commands/learn.d.ts +0 -8
- package/dist/commands/learn.d.ts.map +0 -1
- package/dist/commands/learn.js +0 -33
- package/dist/commands/learn.js.map +0 -1
- package/dist/commands/ledger.d.ts +0 -15
- package/dist/commands/ledger.d.ts.map +0 -1
- package/dist/commands/ledger.js +0 -137
- package/dist/commands/ledger.js.map +0 -1
- package/dist/commands/lessons.d.ts +0 -14
- package/dist/commands/lessons.d.ts.map +0 -1
- package/dist/commands/lessons.js +0 -196
- package/dist/commands/lessons.js.map +0 -1
- package/dist/commands/license-utils.d.ts +0 -36
- package/dist/commands/license-utils.d.ts.map +0 -1
- package/dist/commands/license-utils.js +0 -74
- package/dist/commands/license-utils.js.map +0 -1
- package/dist/commands/license.d.ts +0 -50
- package/dist/commands/license.d.ts.map +0 -1
- package/dist/commands/license.js +0 -281
- package/dist/commands/license.js.map +0 -1
- package/dist/commands/manifest.d.ts +0 -8
- package/dist/commands/manifest.d.ts.map +0 -1
- package/dist/commands/manifest.js +0 -144
- package/dist/commands/manifest.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -14
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -70
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/memory.d.ts +0 -16
- package/dist/commands/memory.d.ts.map +0 -1
- package/dist/commands/memory.js +0 -621
- package/dist/commands/memory.js.map +0 -1
- package/dist/commands/merge-check.d.ts +0 -15
- package/dist/commands/merge-check.d.ts.map +0 -1
- package/dist/commands/merge-check.js +0 -164
- package/dist/commands/merge-check.js.map +0 -1
- package/dist/commands/open-init.d.ts +0 -13
- package/dist/commands/open-init.d.ts.map +0 -1
- package/dist/commands/open-init.js +0 -115
- package/dist/commands/open-init.js.map +0 -1
- package/dist/commands/open-license.d.ts +0 -11
- package/dist/commands/open-license.d.ts.map +0 -1
- package/dist/commands/open-license.js +0 -98
- package/dist/commands/open-license.js.map +0 -1
- package/dist/commands/orchestrate.d.ts +0 -12
- package/dist/commands/orchestrate.d.ts.map +0 -1
- package/dist/commands/orchestrate.js +0 -119
- package/dist/commands/orchestrate.js.map +0 -1
- package/dist/commands/outcome.d.ts +0 -2
- package/dist/commands/outcome.d.ts.map +0 -1
- package/dist/commands/outcome.js +0 -121
- package/dist/commands/outcome.js.map +0 -1
- package/dist/commands/pack.d.ts +0 -12
- package/dist/commands/pack.d.ts.map +0 -1
- package/dist/commands/pack.js +0 -75
- package/dist/commands/pack.js.map +0 -1
- package/dist/commands/policy-author.d.ts +0 -48
- package/dist/commands/policy-author.d.ts.map +0 -1
- package/dist/commands/policy-author.js +0 -396
- package/dist/commands/policy-author.js.map +0 -1
- package/dist/commands/policy-simulate.d.ts +0 -9
- package/dist/commands/policy-simulate.d.ts.map +0 -1
- package/dist/commands/policy-simulate.js +0 -46
- package/dist/commands/policy-simulate.js.map +0 -1
- package/dist/commands/policy.d.ts +0 -9
- package/dist/commands/policy.d.ts.map +0 -1
- package/dist/commands/policy.js +0 -121
- package/dist/commands/policy.js.map +0 -1
- package/dist/commands/post-merge-outcome.d.ts +0 -2
- package/dist/commands/post-merge-outcome.d.ts.map +0 -1
- package/dist/commands/post-merge-outcome.js +0 -32
- package/dist/commands/post-merge-outcome.js.map +0 -1
- package/dist/commands/pr-check.d.ts +0 -18
- package/dist/commands/pr-check.d.ts.map +0 -1
- package/dist/commands/pr-check.js +0 -299
- package/dist/commands/pr-check.js.map +0 -1
- package/dist/commands/pr-comment.d.ts +0 -2
- package/dist/commands/pr-comment.d.ts.map +0 -1
- package/dist/commands/pr-comment.js +0 -96
- package/dist/commands/pr-comment.js.map +0 -1
- package/dist/commands/pr-summary.d.ts +0 -59
- package/dist/commands/pr-summary.d.ts.map +0 -1
- package/dist/commands/pr-summary.js +0 -524
- package/dist/commands/pr-summary.js.map +0 -1
- package/dist/commands/pre-pr.d.ts +0 -14
- package/dist/commands/pre-pr.d.ts.map +0 -1
- package/dist/commands/pre-pr.js +0 -57
- package/dist/commands/pre-pr.js.map +0 -1
- package/dist/commands/preflight.d.ts +0 -2
- package/dist/commands/preflight.d.ts.map +0 -1
- package/dist/commands/preflight.js +0 -48
- package/dist/commands/preflight.js.map +0 -1
- package/dist/commands/progress-check.d.ts +0 -14
- package/dist/commands/progress-check.d.ts.map +0 -1
- package/dist/commands/progress-check.js +0 -153
- package/dist/commands/progress-check.js.map +0 -1
- package/dist/commands/provenance.d.ts +0 -10
- package/dist/commands/provenance.d.ts.map +0 -1
- package/dist/commands/provenance.js +0 -103
- package/dist/commands/provenance.js.map +0 -1
- package/dist/commands/pulse.d.ts +0 -12
- package/dist/commands/pulse.d.ts.map +0 -1
- package/dist/commands/pulse.js +0 -61
- package/dist/commands/pulse.js.map +0 -1
- package/dist/commands/reality-check.d.ts +0 -4
- package/dist/commands/reality-check.d.ts.map +0 -1
- package/dist/commands/reality-check.js +0 -133
- package/dist/commands/reality-check.js.map +0 -1
- package/dist/commands/refine.d.ts +0 -17
- package/dist/commands/refine.d.ts.map +0 -1
- package/dist/commands/refine.js +0 -250
- package/dist/commands/refine.js.map +0 -1
- package/dist/commands/release-check.d.ts +0 -14
- package/dist/commands/release-check.d.ts.map +0 -1
- package/dist/commands/release-check.js +0 -44
- package/dist/commands/release-check.js.map +0 -1
- package/dist/commands/release-decision.d.ts +0 -2
- package/dist/commands/release-decision.d.ts.map +0 -1
- package/dist/commands/release-decision.js +0 -26
- package/dist/commands/release-decision.js.map +0 -1
- package/dist/commands/release-history.d.ts +0 -2
- package/dist/commands/release-history.d.ts.map +0 -1
- package/dist/commands/release-history.js +0 -34
- package/dist/commands/release-history.js.map +0 -1
- package/dist/commands/release-insights.d.ts +0 -2
- package/dist/commands/release-insights.d.ts.map +0 -1
- package/dist/commands/release-insights.js +0 -34
- package/dist/commands/release-insights.js.map +0 -1
- package/dist/commands/release-truth.d.ts +0 -2
- package/dist/commands/release-truth.d.ts.map +0 -1
- package/dist/commands/release-truth.js +0 -15
- package/dist/commands/release-truth.js.map +0 -1
- package/dist/commands/replay.d.ts +0 -2
- package/dist/commands/replay.d.ts.map +0 -1
- package/dist/commands/replay.js +0 -181
- package/dist/commands/replay.js.map +0 -1
- package/dist/commands/review-coverage.d.ts +0 -12
- package/dist/commands/review-coverage.d.ts.map +0 -1
- package/dist/commands/review-coverage.js +0 -142
- package/dist/commands/review-coverage.js.map +0 -1
- package/dist/commands/review-gate.d.ts +0 -12
- package/dist/commands/review-gate.d.ts.map +0 -1
- package/dist/commands/review-gate.js +0 -130
- package/dist/commands/review-gate.js.map +0 -1
- package/dist/commands/run.d.ts +0 -2
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -84
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/runs.d.ts +0 -2
- package/dist/commands/runs.d.ts.map +0 -1
- package/dist/commands/runs.js +0 -61
- package/dist/commands/runs.js.map +0 -1
- package/dist/commands/scan.d.ts +0 -2
- package/dist/commands/scan.d.ts.map +0 -1
- package/dist/commands/scan.js +0 -349
- package/dist/commands/scan.js.map +0 -1
- package/dist/commands/serve.d.ts +0 -32
- package/dist/commands/serve.d.ts.map +0 -1
- package/dist/commands/serve.js +0 -904
- package/dist/commands/serve.js.map +0 -1
- package/dist/commands/session-cleanup.d.ts +0 -11
- package/dist/commands/session-cleanup.d.ts.map +0 -1
- package/dist/commands/session-cleanup.js +0 -85
- package/dist/commands/session-cleanup.js.map +0 -1
- package/dist/commands/session-init.d.ts +0 -10
- package/dist/commands/session-init.d.ts.map +0 -1
- package/dist/commands/session-init.js +0 -46
- package/dist/commands/session-init.js.map +0 -1
- package/dist/commands/session-progress.d.ts +0 -12
- package/dist/commands/session-progress.d.ts.map +0 -1
- package/dist/commands/session-progress.js +0 -287
- package/dist/commands/session-progress.js.map +0 -1
- package/dist/commands/session-summary.d.ts +0 -14
- package/dist/commands/session-summary.d.ts.map +0 -1
- package/dist/commands/session-summary.js +0 -1413
- package/dist/commands/session-summary.js.map +0 -1
- package/dist/commands/sessions.d.ts +0 -9
- package/dist/commands/sessions.d.ts.map +0 -1
- package/dist/commands/sessions.js +0 -60
- package/dist/commands/sessions.js.map +0 -1
- package/dist/commands/setup-ci.d.ts +0 -27
- package/dist/commands/setup-ci.d.ts.map +0 -1
- package/dist/commands/setup-ci.js +0 -487
- package/dist/commands/setup-ci.js.map +0 -1
- package/dist/commands/share.d.ts +0 -9
- package/dist/commands/share.d.ts.map +0 -1
- package/dist/commands/share.js +0 -275
- package/dist/commands/share.js.map +0 -1
- package/dist/commands/shared-summary.d.ts +0 -15
- package/dist/commands/shared-summary.d.ts.map +0 -1
- package/dist/commands/shared-summary.js +0 -194
- package/dist/commands/shared-summary.js.map +0 -1
- package/dist/commands/sign-manifest.d.ts +0 -8
- package/dist/commands/sign-manifest.d.ts.map +0 -1
- package/dist/commands/sign-manifest.js +0 -58
- package/dist/commands/sign-manifest.js.map +0 -1
- package/dist/commands/snapshot.d.ts +0 -4
- package/dist/commands/snapshot.d.ts.map +0 -1
- package/dist/commands/snapshot.js +0 -79
- package/dist/commands/snapshot.js.map +0 -1
- package/dist/commands/stats.d.ts +0 -8
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js +0 -164
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -9
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js +0 -157
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/task.d.ts +0 -2
- package/dist/commands/task.d.ts.map +0 -1
- package/dist/commands/task.js +0 -315
- package/dist/commands/task.js.map +0 -1
- package/dist/commands/team-ledger.d.ts +0 -11
- package/dist/commands/team-ledger.d.ts.map +0 -1
- package/dist/commands/team-ledger.js +0 -77
- package/dist/commands/team-ledger.js.map +0 -1
- package/dist/commands/team-metrics.d.ts +0 -8
- package/dist/commands/team-metrics.d.ts.map +0 -1
- package/dist/commands/team-metrics.js +0 -57
- package/dist/commands/team-metrics.js.map +0 -1
- package/dist/commands/test-summary.d.ts +0 -2
- package/dist/commands/test-summary.d.ts.map +0 -1
- package/dist/commands/test-summary.js +0 -53
- package/dist/commands/test-summary.js.map +0 -1
- package/dist/commands/time-travel.d.ts +0 -2
- package/dist/commands/time-travel.d.ts.map +0 -1
- package/dist/commands/time-travel.js +0 -89
- package/dist/commands/time-travel.js.map +0 -1
- package/dist/commands/truth-utils.d.ts +0 -14
- package/dist/commands/truth-utils.d.ts.map +0 -1
- package/dist/commands/truth-utils.js +0 -70
- package/dist/commands/truth-utils.js.map +0 -1
- package/dist/commands/upgrade.d.ts +0 -2
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/upgrade.js +0 -17
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/commands/vendor.d.ts +0 -20
- package/dist/commands/vendor.d.ts.map +0 -1
- package/dist/commands/vendor.js +0 -205
- package/dist/commands/vendor.js.map +0 -1
- package/dist/commands/verify.d.ts +0 -36
- package/dist/commands/verify.d.ts.map +0 -1
- package/dist/commands/verify.js +0 -761
- package/dist/commands/verify.js.map +0 -1
- package/dist/completion-integrity/claims.d.ts +0 -21
- package/dist/completion-integrity/claims.d.ts.map +0 -1
- package/dist/completion-integrity/claims.js +0 -99
- package/dist/completion-integrity/claims.js.map +0 -1
- package/dist/completion-integrity/confidence.d.ts +0 -30
- package/dist/completion-integrity/confidence.d.ts.map +0 -1
- package/dist/completion-integrity/confidence.js +0 -86
- package/dist/completion-integrity/confidence.js.map +0 -1
- package/dist/completion-integrity/ghost-detector.d.ts +0 -37
- package/dist/completion-integrity/ghost-detector.d.ts.map +0 -1
- package/dist/completion-integrity/ghost-detector.js +0 -93
- package/dist/completion-integrity/ghost-detector.js.map +0 -1
- package/dist/completion-integrity/history.d.ts +0 -19
- package/dist/completion-integrity/history.d.ts.map +0 -1
- package/dist/completion-integrity/history.js +0 -44
- package/dist/completion-integrity/history.js.map +0 -1
- package/dist/completion-integrity/index.d.ts +0 -25
- package/dist/completion-integrity/index.d.ts.map +0 -1
- package/dist/completion-integrity/index.js +0 -251
- package/dist/completion-integrity/index.js.map +0 -1
- package/dist/completion-integrity/neighborhood.d.ts +0 -21
- package/dist/completion-integrity/neighborhood.d.ts.map +0 -1
- package/dist/completion-integrity/neighborhood.js +0 -274
- package/dist/completion-integrity/neighborhood.js.map +0 -1
- package/dist/completion-integrity/notary.d.ts +0 -3
- package/dist/completion-integrity/notary.d.ts.map +0 -1
- package/dist/completion-integrity/notary.js +0 -124
- package/dist/completion-integrity/notary.js.map +0 -1
- package/dist/completion-integrity/output.d.ts +0 -11
- package/dist/completion-integrity/output.d.ts.map +0 -1
- package/dist/completion-integrity/output.js +0 -228
- package/dist/completion-integrity/output.js.map +0 -1
- package/dist/completion-integrity/self-audit.d.ts +0 -28
- package/dist/completion-integrity/self-audit.d.ts.map +0 -1
- package/dist/completion-integrity/self-audit.js +0 -194
- package/dist/completion-integrity/self-audit.js.map +0 -1
- package/dist/completion-integrity/semantic-drift.d.ts +0 -22
- package/dist/completion-integrity/semantic-drift.d.ts.map +0 -1
- package/dist/completion-integrity/semantic-drift.js +0 -138
- package/dist/completion-integrity/semantic-drift.js.map +0 -1
- package/dist/completion-integrity/state-machine.d.ts +0 -36
- package/dist/completion-integrity/state-machine.d.ts.map +0 -1
- package/dist/completion-integrity/state-machine.js +0 -138
- package/dist/completion-integrity/state-machine.js.map +0 -1
- package/dist/completion-integrity/types.d.ts +0 -69
- package/dist/completion-integrity/types.d.ts.map +0 -1
- package/dist/completion-integrity/types.js +0 -4
- package/dist/completion-integrity/types.js.map +0 -1
- package/dist/context-engine/contract.d.ts +0 -12
- package/dist/context-engine/contract.d.ts.map +0 -1
- package/dist/context-engine/contract.js +0 -227
- package/dist/context-engine/contract.js.map +0 -1
- package/dist/context-engine/delta.d.ts +0 -10
- package/dist/context-engine/delta.d.ts.map +0 -1
- package/dist/context-engine/delta.js +0 -78
- package/dist/context-engine/delta.js.map +0 -1
- package/dist/context-engine/index.d.ts +0 -6
- package/dist/context-engine/index.d.ts.map +0 -1
- package/dist/context-engine/index.js +0 -5
- package/dist/context-engine/index.js.map +0 -1
- package/dist/context-engine/policy-evaluator.d.ts +0 -32
- package/dist/context-engine/policy-evaluator.d.ts.map +0 -1
- package/dist/context-engine/policy-evaluator.js +0 -69
- package/dist/context-engine/policy-evaluator.js.map +0 -1
- package/dist/context-engine/renderer.d.ts +0 -9
- package/dist/context-engine/renderer.d.ts.map +0 -1
- package/dist/context-engine/renderer.js +0 -28
- package/dist/context-engine/renderer.js.map +0 -1
- package/dist/context-engine/renderers/claude.d.ts +0 -3
- package/dist/context-engine/renderers/claude.d.ts.map +0 -1
- package/dist/context-engine/renderers/claude.js +0 -223
- package/dist/context-engine/renderers/claude.js.map +0 -1
- package/dist/context-engine/renderers/cursor.d.ts +0 -3
- package/dist/context-engine/renderers/cursor.d.ts.map +0 -1
- package/dist/context-engine/renderers/cursor.js +0 -158
- package/dist/context-engine/renderers/cursor.js.map +0 -1
- package/dist/context-engine/renderers/generic.d.ts +0 -3
- package/dist/context-engine/renderers/generic.d.ts.map +0 -1
- package/dist/context-engine/renderers/generic.js +0 -180
- package/dist/context-engine/renderers/generic.js.map +0 -1
- package/dist/coordination/index.d.ts +0 -69
- package/dist/coordination/index.d.ts.map +0 -1
- package/dist/coordination/index.js +0 -1110
- package/dist/coordination/index.js.map +0 -1
- package/dist/discovery/blast-radius.d.ts +0 -15
- package/dist/discovery/blast-radius.d.ts.map +0 -1
- package/dist/discovery/blast-radius.js +0 -160
- package/dist/discovery/blast-radius.js.map +0 -1
- package/dist/discovery/cache.d.ts +0 -38
- package/dist/discovery/cache.d.ts.map +0 -1
- package/dist/discovery/cache.js +0 -87
- package/dist/discovery/cache.js.map +0 -1
- package/dist/discovery/diff-compliance.d.ts +0 -19
- package/dist/discovery/diff-compliance.d.ts.map +0 -1
- package/dist/discovery/diff-compliance.js +0 -96
- package/dist/discovery/diff-compliance.js.map +0 -1
- package/dist/discovery/duplicate-detection.d.ts +0 -29
- package/dist/discovery/duplicate-detection.d.ts.map +0 -1
- package/dist/discovery/duplicate-detection.js +0 -133
- package/dist/discovery/duplicate-detection.js.map +0 -1
- package/dist/discovery/gap-analysis.d.ts +0 -16
- package/dist/discovery/gap-analysis.d.ts.map +0 -1
- package/dist/discovery/gap-analysis.js +0 -199
- package/dist/discovery/gap-analysis.js.map +0 -1
- package/dist/discovery/index.d.ts +0 -18
- package/dist/discovery/index.d.ts.map +0 -1
- package/dist/discovery/index.js +0 -565
- package/dist/discovery/index.js.map +0 -1
- package/dist/discovery/override.d.ts +0 -19
- package/dist/discovery/override.d.ts.map +0 -1
- package/dist/discovery/override.js +0 -113
- package/dist/discovery/override.js.map +0 -1
- package/dist/discovery/scoring.d.ts +0 -35
- package/dist/discovery/scoring.d.ts.map +0 -1
- package/dist/discovery/scoring.js +0 -194
- package/dist/discovery/scoring.js.map +0 -1
- package/dist/discovery/source-of-truth.d.ts +0 -17
- package/dist/discovery/source-of-truth.d.ts.map +0 -1
- package/dist/discovery/source-of-truth.js +0 -182
- package/dist/discovery/source-of-truth.js.map +0 -1
- package/dist/discovery/symbol-growth.d.ts +0 -20
- package/dist/discovery/symbol-growth.d.ts.map +0 -1
- package/dist/discovery/symbol-growth.js +0 -111
- package/dist/discovery/symbol-growth.js.map +0 -1
- package/dist/ecl/git-sync.d.ts +0 -53
- package/dist/ecl/git-sync.d.ts.map +0 -1
- package/dist/ecl/git-sync.js +0 -182
- package/dist/ecl/git-sync.js.map +0 -1
- package/dist/ecl/lifecycle.d.ts +0 -107
- package/dist/ecl/lifecycle.d.ts.map +0 -1
- package/dist/ecl/lifecycle.js +0 -264
- package/dist/ecl/lifecycle.js.map +0 -1
- package/dist/ecl/persistence.d.ts +0 -108
- package/dist/ecl/persistence.d.ts.map +0 -1
- package/dist/ecl/persistence.js +0 -362
- package/dist/ecl/persistence.js.map +0 -1
- package/dist/ecl/sync.d.ts +0 -43
- package/dist/ecl/sync.d.ts.map +0 -1
- package/dist/ecl/sync.js +0 -155
- package/dist/ecl/sync.js.map +0 -1
- package/dist/feedback/index.d.ts +0 -35
- package/dist/feedback/index.d.ts.map +0 -1
- package/dist/feedback/index.js +0 -81
- package/dist/feedback/index.js.map +0 -1
- package/dist/guardrails/adversarial-trigger.d.ts +0 -15
- package/dist/guardrails/adversarial-trigger.d.ts.map +0 -1
- package/dist/guardrails/adversarial-trigger.js +0 -86
- package/dist/guardrails/adversarial-trigger.js.map +0 -1
- package/dist/guardrails/export-collision.d.ts +0 -11
- package/dist/guardrails/export-collision.d.ts.map +0 -1
- package/dist/guardrails/export-collision.js +0 -141
- package/dist/guardrails/export-collision.js.map +0 -1
- package/dist/guardrails/index.d.ts +0 -24
- package/dist/guardrails/index.d.ts.map +0 -1
- package/dist/guardrails/index.js +0 -24
- package/dist/guardrails/index.js.map +0 -1
- package/dist/guardrails/release-tag.d.ts +0 -10
- package/dist/guardrails/release-tag.d.ts.map +0 -1
- package/dist/guardrails/release-tag.js +0 -99
- package/dist/guardrails/release-tag.js.map +0 -1
- package/dist/guardrails/rename-integrity.d.ts +0 -13
- package/dist/guardrails/rename-integrity.d.ts.map +0 -1
- package/dist/guardrails/rename-integrity.js +0 -111
- package/dist/guardrails/rename-integrity.js.map +0 -1
- package/dist/guardrails/runner.d.ts +0 -10
- package/dist/guardrails/runner.d.ts.map +0 -1
- package/dist/guardrails/runner.js +0 -36
- package/dist/guardrails/runner.js.map +0 -1
- package/dist/guardrails/stale-artifact.d.ts +0 -11
- package/dist/guardrails/stale-artifact.d.ts.map +0 -1
- package/dist/guardrails/stale-artifact.js +0 -69
- package/dist/guardrails/stale-artifact.js.map +0 -1
- package/dist/guardrails/unused-parameter.d.ts +0 -11
- package/dist/guardrails/unused-parameter.d.ts.map +0 -1
- package/dist/guardrails/unused-parameter.js +0 -105
- package/dist/guardrails/unused-parameter.js.map +0 -1
- package/dist/guardrails/workspace-validation.d.ts +0 -12
- package/dist/guardrails/workspace-validation.d.ts.map +0 -1
- package/dist/guardrails/workspace-validation.js +0 -92
- package/dist/guardrails/workspace-validation.js.map +0 -1
- package/dist/health/advisor.d.ts +0 -18
- package/dist/health/advisor.d.ts.map +0 -1
- package/dist/health/advisor.js +0 -174
- package/dist/health/advisor.js.map +0 -1
- package/dist/health/dashboard.d.ts +0 -96
- package/dist/health/dashboard.d.ts.map +0 -1
- package/dist/health/dashboard.js +0 -470
- package/dist/health/dashboard.js.map +0 -1
- package/dist/hooks/discovery-enforcement.d.ts +0 -9
- package/dist/hooks/discovery-enforcement.d.ts.map +0 -1
- package/dist/hooks/discovery-enforcement.js +0 -137
- package/dist/hooks/discovery-enforcement.js.map +0 -1
- package/dist/hooks/discovery-hook.d.ts +0 -22
- package/dist/hooks/discovery-hook.d.ts.map +0 -1
- package/dist/hooks/discovery-hook.js +0 -199
- package/dist/hooks/discovery-hook.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1499
- package/dist/index.js.map +0 -1
- package/dist/insight/emit.d.ts +0 -19
- package/dist/insight/emit.d.ts.map +0 -1
- package/dist/insight/emit.js +0 -107
- package/dist/insight/emit.js.map +0 -1
- package/dist/insight/engine-bridge.d.ts +0 -7
- package/dist/insight/engine-bridge.d.ts.map +0 -1
- package/dist/insight/engine-bridge.js +0 -6
- package/dist/insight/engine-bridge.js.map +0 -1
- package/dist/insight/index.d.ts +0 -3
- package/dist/insight/index.d.ts.map +0 -1
- package/dist/insight/index.js +0 -2
- package/dist/insight/index.js.map +0 -1
- package/dist/insight/telemetry.d.ts +0 -14
- package/dist/insight/telemetry.d.ts.map +0 -1
- package/dist/insight/telemetry.js +0 -87
- package/dist/insight/telemetry.js.map +0 -1
- package/dist/intake/candidate-paths/CandidatePathDetector.d.ts +0 -5
- package/dist/intake/candidate-paths/CandidatePathDetector.d.ts.map +0 -1
- package/dist/intake/candidate-paths/CandidatePathDetector.js +0 -173
- package/dist/intake/candidate-paths/CandidatePathDetector.js.map +0 -1
- package/dist/intake/candidate-paths/anchorRadiusExpansion.d.ts +0 -4
- package/dist/intake/candidate-paths/anchorRadiusExpansion.d.ts.map +0 -1
- package/dist/intake/candidate-paths/anchorRadiusExpansion.js +0 -66
- package/dist/intake/candidate-paths/anchorRadiusExpansion.js.map +0 -1
- package/dist/intake/candidate-paths/applyNegativeFiltering.d.ts +0 -4
- package/dist/intake/candidate-paths/applyNegativeFiltering.d.ts.map +0 -1
- package/dist/intake/candidate-paths/applyNegativeFiltering.js +0 -24
- package/dist/intake/candidate-paths/applyNegativeFiltering.js.map +0 -1
- package/dist/intake/candidate-paths/coCommitAnalyzer.d.ts +0 -3
- package/dist/intake/candidate-paths/coCommitAnalyzer.d.ts.map +0 -1
- package/dist/intake/candidate-paths/coCommitAnalyzer.js +0 -27
- package/dist/intake/candidate-paths/coCommitAnalyzer.js.map +0 -1
- package/dist/intake/candidate-paths/computeConfidence.d.ts +0 -3
- package/dist/intake/candidate-paths/computeConfidence.d.ts.map +0 -1
- package/dist/intake/candidate-paths/computeConfidence.js +0 -14
- package/dist/intake/candidate-paths/computeConfidence.js.map +0 -1
- package/dist/intake/candidate-paths/consolidateCandidates.d.ts +0 -5
- package/dist/intake/candidate-paths/consolidateCandidates.d.ts.map +0 -1
- package/dist/intake/candidate-paths/consolidateCandidates.js +0 -61
- package/dist/intake/candidate-paths/consolidateCandidates.js.map +0 -1
- package/dist/intake/candidate-paths/hierarchicalMatching.d.ts +0 -7
- package/dist/intake/candidate-paths/hierarchicalMatching.d.ts.map +0 -1
- package/dist/intake/candidate-paths/hierarchicalMatching.js +0 -46
- package/dist/intake/candidate-paths/hierarchicalMatching.js.map +0 -1
- package/dist/intake/candidate-paths/integration.d.ts +0 -7
- package/dist/intake/candidate-paths/integration.d.ts.map +0 -1
- package/dist/intake/candidate-paths/integration.js +0 -63
- package/dist/intake/candidate-paths/integration.js.map +0 -1
- package/dist/intake/candidate-paths/pathDetectionOverrides.d.ts +0 -3
- package/dist/intake/candidate-paths/pathDetectionOverrides.d.ts.map +0 -1
- package/dist/intake/candidate-paths/pathDetectionOverrides.js +0 -134
- package/dist/intake/candidate-paths/pathDetectionOverrides.js.map +0 -1
- package/dist/intake/candidate-paths/repoIndexAdapter.d.ts +0 -4
- package/dist/intake/candidate-paths/repoIndexAdapter.d.ts.map +0 -1
- package/dist/intake/candidate-paths/repoIndexAdapter.js +0 -99
- package/dist/intake/candidate-paths/repoIndexAdapter.js.map +0 -1
- package/dist/intake/candidate-paths/resolveExplicitTargets.d.ts +0 -8
- package/dist/intake/candidate-paths/resolveExplicitTargets.d.ts.map +0 -1
- package/dist/intake/candidate-paths/resolveExplicitTargets.js +0 -65
- package/dist/intake/candidate-paths/resolveExplicitTargets.js.map +0 -1
- package/dist/intake/candidate-paths/rules.d.ts +0 -13
- package/dist/intake/candidate-paths/rules.d.ts.map +0 -1
- package/dist/intake/candidate-paths/rules.js +0 -64
- package/dist/intake/candidate-paths/rules.js.map +0 -1
- package/dist/intake/candidate-paths/scoreIntentSurfaceMatches.d.ts +0 -10
- package/dist/intake/candidate-paths/scoreIntentSurfaceMatches.d.ts.map +0 -1
- package/dist/intake/candidate-paths/scoreIntentSurfaceMatches.js +0 -73
- package/dist/intake/candidate-paths/scoreIntentSurfaceMatches.js.map +0 -1
- package/dist/intake/candidate-paths/shapeEstimator.d.ts +0 -3
- package/dist/intake/candidate-paths/shapeEstimator.d.ts.map +0 -1
- package/dist/intake/candidate-paths/shapeEstimator.js +0 -17
- package/dist/intake/candidate-paths/shapeEstimator.js.map +0 -1
- package/dist/intake/candidate-paths/types.d.ts +0 -148
- package/dist/intake/candidate-paths/types.d.ts.map +0 -1
- package/dist/intake/candidate-paths/types.js +0 -2
- package/dist/intake/candidate-paths/types.js.map +0 -1
- package/dist/intake/task-classifier/TaskClassifier.d.ts +0 -5
- package/dist/intake/task-classifier/TaskClassifier.d.ts.map +0 -1
- package/dist/intake/task-classifier/TaskClassifier.js +0 -96
- package/dist/intake/task-classifier/TaskClassifier.js.map +0 -1
- package/dist/intake/task-classifier/applyOverrides.d.ts +0 -3
- package/dist/intake/task-classifier/applyOverrides.d.ts.map +0 -1
- package/dist/intake/task-classifier/applyOverrides.js +0 -55
- package/dist/intake/task-classifier/applyOverrides.js.map +0 -1
- package/dist/intake/task-classifier/computeConfidence.d.ts +0 -3
- package/dist/intake/task-classifier/computeConfidence.d.ts.map +0 -1
- package/dist/intake/task-classifier/computeConfidence.js +0 -13
- package/dist/intake/task-classifier/computeConfidence.js.map +0 -1
- package/dist/intake/task-classifier/deriveRiskAndComplexity.d.ts +0 -4
- package/dist/intake/task-classifier/deriveRiskAndComplexity.d.ts.map +0 -1
- package/dist/intake/task-classifier/deriveRiskAndComplexity.js +0 -24
- package/dist/intake/task-classifier/deriveRiskAndComplexity.js.map +0 -1
- package/dist/intake/task-classifier/deriveTags.d.ts +0 -3
- package/dist/intake/task-classifier/deriveTags.d.ts.map +0 -1
- package/dist/intake/task-classifier/deriveTags.js +0 -43
- package/dist/intake/task-classifier/deriveTags.js.map +0 -1
- package/dist/intake/task-classifier/index.d.ts +0 -6
- package/dist/intake/task-classifier/index.d.ts.map +0 -1
- package/dist/intake/task-classifier/index.js +0 -6
- package/dist/intake/task-classifier/index.js.map +0 -1
- package/dist/intake/task-classifier/mergeScores.d.ts +0 -4
- package/dist/intake/task-classifier/mergeScores.d.ts.map +0 -1
- package/dist/intake/task-classifier/mergeScores.js +0 -68
- package/dist/intake/task-classifier/mergeScores.js.map +0 -1
- package/dist/intake/task-classifier/pathMatching.d.ts +0 -3
- package/dist/intake/task-classifier/pathMatching.d.ts.map +0 -1
- package/dist/intake/task-classifier/pathMatching.js +0 -33
- package/dist/intake/task-classifier/pathMatching.js.map +0 -1
- package/dist/intake/task-classifier/rules.d.ts +0 -28
- package/dist/intake/task-classifier/rules.d.ts.map +0 -1
- package/dist/intake/task-classifier/rules.js +0 -138
- package/dist/intake/task-classifier/rules.js.map +0 -1
- package/dist/intake/task-classifier/scoreKeywords.d.ts +0 -5
- package/dist/intake/task-classifier/scoreKeywords.d.ts.map +0 -1
- package/dist/intake/task-classifier/scoreKeywords.js +0 -41
- package/dist/intake/task-classifier/scoreKeywords.js.map +0 -1
- package/dist/intake/task-classifier/scoreMetadata.d.ts +0 -3
- package/dist/intake/task-classifier/scoreMetadata.d.ts.map +0 -1
- package/dist/intake/task-classifier/scoreMetadata.js +0 -29
- package/dist/intake/task-classifier/scoreMetadata.js.map +0 -1
- package/dist/intake/task-classifier/scorePaths.d.ts +0 -3
- package/dist/intake/task-classifier/scorePaths.d.ts.map +0 -1
- package/dist/intake/task-classifier/scorePaths.js +0 -38
- package/dist/intake/task-classifier/scorePaths.js.map +0 -1
- package/dist/intake/task-classifier/types.d.ts +0 -51
- package/dist/intake/task-classifier/types.d.ts.map +0 -1
- package/dist/intake/task-classifier/types.js +0 -2
- package/dist/intake/task-classifier/types.js.map +0 -1
- package/dist/integrations/github-actions.d.ts +0 -17
- package/dist/integrations/github-actions.d.ts.map +0 -1
- package/dist/integrations/github-actions.js +0 -77
- package/dist/integrations/github-actions.js.map +0 -1
- package/dist/intent/extractor.d.ts +0 -15
- package/dist/intent/extractor.d.ts.map +0 -1
- package/dist/intent/extractor.js +0 -149
- package/dist/intent/extractor.js.map +0 -1
- package/dist/intent/fetcher.d.ts +0 -33
- package/dist/intent/fetcher.d.ts.map +0 -1
- package/dist/intent/fetcher.js +0 -364
- package/dist/intent/fetcher.js.map +0 -1
- package/dist/intent/loader.d.ts +0 -26
- package/dist/intent/loader.d.ts.map +0 -1
- package/dist/intent/loader.js +0 -80
- package/dist/intent/loader.js.map +0 -1
- package/dist/intent/types.d.ts +0 -33
- package/dist/intent/types.d.ts.map +0 -1
- package/dist/intent/types.js +0 -9
- package/dist/intent/types.js.map +0 -1
- package/dist/intervention/drift-velocity.d.ts +0 -19
- package/dist/intervention/drift-velocity.d.ts.map +0 -1
- package/dist/intervention/drift-velocity.js +0 -107
- package/dist/intervention/drift-velocity.js.map +0 -1
- package/dist/intervention/engine.d.ts +0 -43
- package/dist/intervention/engine.d.ts.map +0 -1
- package/dist/intervention/engine.js +0 -356
- package/dist/intervention/engine.js.map +0 -1
- package/dist/intervention/templates.d.ts +0 -23
- package/dist/intervention/templates.d.ts.map +0 -1
- package/dist/intervention/templates.js +0 -167
- package/dist/intervention/templates.js.map +0 -1
- package/dist/manifest/build.d.ts +0 -19
- package/dist/manifest/build.d.ts.map +0 -1
- package/dist/manifest/build.js +0 -82
- package/dist/manifest/build.js.map +0 -1
- package/dist/manifest/schema.d.ts +0 -2
- package/dist/manifest/schema.d.ts.map +0 -1
- package/dist/manifest/schema.js +0 -2
- package/dist/manifest/schema.js.map +0 -1
- package/dist/manifest/write.d.ts +0 -13
- package/dist/manifest/write.d.ts.map +0 -1
- package/dist/manifest/write.js +0 -69
- package/dist/manifest/write.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -20
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -271
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/skill-template.d.ts +0 -10
- package/dist/mcp/skill-template.d.ts.map +0 -1
- package/dist/mcp/skill-template.js +0 -75
- package/dist/mcp/skill-template.js.map +0 -1
- package/dist/memory/TaskClassifier.d.ts +0 -6
- package/dist/memory/TaskClassifier.d.ts.map +0 -1
- package/dist/memory/TaskClassifier.js +0 -344
- package/dist/memory/TaskClassifier.js.map +0 -1
- package/dist/memory/context-injection.d.ts +0 -12
- package/dist/memory/context-injection.d.ts.map +0 -1
- package/dist/memory/context-injection.js +0 -550
- package/dist/memory/context-injection.js.map +0 -1
- package/dist/memory/evidence-gates.d.ts +0 -32
- package/dist/memory/evidence-gates.d.ts.map +0 -1
- package/dist/memory/evidence-gates.js +0 -168
- package/dist/memory/evidence-gates.js.map +0 -1
- package/dist/memory/golden-patterns.d.ts +0 -68
- package/dist/memory/golden-patterns.d.ts.map +0 -1
- package/dist/memory/golden-patterns.js +0 -260
- package/dist/memory/golden-patterns.js.map +0 -1
- package/dist/memory/index.d.ts +0 -11
- package/dist/memory/index.d.ts.map +0 -1
- package/dist/memory/index.js +0 -11
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/lessons.d.ts +0 -88
- package/dist/memory/lessons.d.ts.map +0 -1
- package/dist/memory/lessons.js +0 -370
- package/dist/memory/lessons.js.map +0 -1
- package/dist/memory/ontology.d.ts +0 -34
- package/dist/memory/ontology.d.ts.map +0 -1
- package/dist/memory/ontology.js +0 -125
- package/dist/memory/ontology.js.map +0 -1
- package/dist/memory/policy-artifacts.d.ts +0 -31
- package/dist/memory/policy-artifacts.d.ts.map +0 -1
- package/dist/memory/policy-artifacts.js +0 -618
- package/dist/memory/policy-artifacts.js.map +0 -1
- package/dist/memory/preamble.d.ts +0 -35
- package/dist/memory/preamble.d.ts.map +0 -1
- package/dist/memory/preamble.js +0 -114
- package/dist/memory/preamble.js.map +0 -1
- package/dist/memory/recent-truth.d.ts +0 -21
- package/dist/memory/recent-truth.d.ts.map +0 -1
- package/dist/memory/recent-truth.js +0 -78
- package/dist/memory/recent-truth.js.map +0 -1
- package/dist/memory/storage.d.ts +0 -28
- package/dist/memory/storage.d.ts.map +0 -1
- package/dist/memory/storage.js +0 -204
- package/dist/memory/storage.js.map +0 -1
- package/dist/memory/structural-trust.d.ts +0 -36
- package/dist/memory/structural-trust.d.ts.map +0 -1
- package/dist/memory/structural-trust.js +0 -77
- package/dist/memory/structural-trust.js.map +0 -1
- package/dist/memory/taskClassifierOverrides.d.ts +0 -3
- package/dist/memory/taskClassifierOverrides.d.ts.map +0 -1
- package/dist/memory/taskClassifierOverrides.js +0 -153
- package/dist/memory/taskClassifierOverrides.js.map +0 -1
- package/dist/memory/taskClassifierRules.d.ts +0 -15
- package/dist/memory/taskClassifierRules.d.ts.map +0 -1
- package/dist/memory/taskClassifierRules.js +0 -277
- package/dist/memory/taskClassifierRules.js.map +0 -1
- package/dist/memory/taskClassifierTypes.d.ts +0 -40
- package/dist/memory/taskClassifierTypes.d.ts.map +0 -1
- package/dist/memory/taskClassifierTypes.js +0 -2
- package/dist/memory/taskClassifierTypes.js.map +0 -1
- package/dist/memory/validation-ledger.d.ts +0 -28
- package/dist/memory/validation-ledger.d.ts.map +0 -1
- package/dist/memory/validation-ledger.js +0 -90
- package/dist/memory/validation-ledger.js.map +0 -1
- package/dist/merge-check/hallucination-guard.d.ts +0 -49
- package/dist/merge-check/hallucination-guard.d.ts.map +0 -1
- package/dist/merge-check/hallucination-guard.js +0 -228
- package/dist/merge-check/hallucination-guard.js.map +0 -1
- package/dist/merge-check/intent-registry.d.ts +0 -42
- package/dist/merge-check/intent-registry.d.ts.map +0 -1
- package/dist/merge-check/intent-registry.js +0 -154
- package/dist/merge-check/intent-registry.js.map +0 -1
- package/dist/merge-check/sentinel.d.ts +0 -60
- package/dist/merge-check/sentinel.d.ts.map +0 -1
- package/dist/merge-check/sentinel.js +0 -399
- package/dist/merge-check/sentinel.js.map +0 -1
- package/dist/narrative/contextNarrative.d.ts +0 -22
- package/dist/narrative/contextNarrative.d.ts.map +0 -1
- package/dist/narrative/contextNarrative.js +0 -259
- package/dist/narrative/contextNarrative.js.map +0 -1
- package/dist/onboarding.d.ts +0 -37
- package/dist/onboarding.d.ts.map +0 -1
- package/dist/onboarding.js +0 -112
- package/dist/onboarding.js.map +0 -1
- package/dist/open-shell.d.ts +0 -14
- package/dist/open-shell.d.ts.map +0 -1
- package/dist/open-shell.js +0 -191
- package/dist/open-shell.js.map +0 -1
- package/dist/policy/load.d.ts +0 -21
- package/dist/policy/load.d.ts.map +0 -1
- package/dist/policy/load.js +0 -63
- package/dist/policy/load.js.map +0 -1
- package/dist/policy/realtime.d.ts +0 -17
- package/dist/policy/realtime.d.ts.map +0 -1
- package/dist/policy/realtime.js +0 -108
- package/dist/policy/realtime.js.map +0 -1
- package/dist/policy/resolve.d.ts +0 -18
- package/dist/policy/resolve.d.ts.map +0 -1
- package/dist/policy/resolve.js +0 -86
- package/dist/policy/resolve.js.map +0 -1
- package/dist/policy/schema.d.ts +0 -22
- package/dist/policy/schema.d.ts.map +0 -1
- package/dist/policy/schema.js +0 -220
- package/dist/policy/schema.js.map +0 -1
- package/dist/pr-comment/renderer.d.ts +0 -3
- package/dist/pr-comment/renderer.d.ts.map +0 -1
- package/dist/pr-comment/renderer.js +0 -32
- package/dist/pr-comment/renderer.js.map +0 -1
- package/dist/pr-comment/templates.d.ts +0 -4
- package/dist/pr-comment/templates.d.ts.map +0 -1
- package/dist/pr-comment/templates.js +0 -9
- package/dist/pr-comment/templates.js.map +0 -1
- package/dist/pr-comment/types.d.ts +0 -13
- package/dist/pr-comment/types.d.ts.map +0 -1
- package/dist/pr-comment/types.js +0 -2
- package/dist/pr-comment/types.js.map +0 -1
- package/dist/pre-pr/checks.d.ts +0 -18
- package/dist/pre-pr/checks.d.ts.map +0 -1
- package/dist/pre-pr/checks.js +0 -440
- package/dist/pre-pr/checks.js.map +0 -1
- package/dist/pre-pr/orchestrator.d.ts +0 -30
- package/dist/pre-pr/orchestrator.d.ts.map +0 -1
- package/dist/pre-pr/orchestrator.js +0 -104
- package/dist/pre-pr/orchestrator.js.map +0 -1
- package/dist/project-config.d.ts +0 -38
- package/dist/project-config.d.ts.map +0 -1
- package/dist/project-config.js +0 -206
- package/dist/project-config.js.map +0 -1
- package/dist/prompt-coach/admission.d.ts +0 -31
- package/dist/prompt-coach/admission.d.ts.map +0 -1
- package/dist/prompt-coach/admission.js +0 -105
- package/dist/prompt-coach/admission.js.map +0 -1
- package/dist/prompt-coach/feedback.d.ts +0 -49
- package/dist/prompt-coach/feedback.d.ts.map +0 -1
- package/dist/prompt-coach/feedback.js +0 -177
- package/dist/prompt-coach/feedback.js.map +0 -1
- package/dist/prompt-coach/format.d.ts +0 -56
- package/dist/prompt-coach/format.d.ts.map +0 -1
- package/dist/prompt-coach/format.js +0 -190
- package/dist/prompt-coach/format.js.map +0 -1
- package/dist/prompt-coach/index.d.ts +0 -13
- package/dist/prompt-coach/index.d.ts.map +0 -1
- package/dist/prompt-coach/index.js +0 -13
- package/dist/prompt-coach/index.js.map +0 -1
- package/dist/prompt-coach/interactive.d.ts +0 -28
- package/dist/prompt-coach/interactive.d.ts.map +0 -1
- package/dist/prompt-coach/interactive.js +0 -118
- package/dist/prompt-coach/interactive.js.map +0 -1
- package/dist/prompt-coach/policy.d.ts +0 -67
- package/dist/prompt-coach/policy.d.ts.map +0 -1
- package/dist/prompt-coach/policy.js +0 -502
- package/dist/prompt-coach/policy.js.map +0 -1
- package/dist/prompt-coach/summary.d.ts +0 -56
- package/dist/prompt-coach/summary.d.ts.map +0 -1
- package/dist/prompt-coach/summary.js +0 -304
- package/dist/prompt-coach/summary.js.map +0 -1
- package/dist/protected-runtime/core.d.ts +0 -7
- package/dist/protected-runtime/core.d.ts.map +0 -1
- package/dist/protected-runtime/core.js +0 -24
- package/dist/protected-runtime/core.js.map +0 -1
- package/dist/protected-runtime/module-loader.d.ts +0 -9
- package/dist/protected-runtime/module-loader.d.ts.map +0 -1
- package/dist/protected-runtime/module-loader.js +0 -54
- package/dist/protected-runtime/module-loader.js.map +0 -1
- package/dist/protected-shell.d.ts +0 -2
- package/dist/protected-shell.d.ts.map +0 -1
- package/dist/protected-shell.js +0 -41
- package/dist/protected-shell.js.map +0 -1
- package/dist/release-check/engine.d.ts +0 -30
- package/dist/release-check/engine.d.ts.map +0 -1
- package/dist/release-check/engine.js +0 -726
- package/dist/release-check/engine.js.map +0 -1
- package/dist/release-check/index.d.ts +0 -16
- package/dist/release-check/index.d.ts.map +0 -1
- package/dist/release-check/index.js +0 -16
- package/dist/release-check/index.js.map +0 -1
- package/dist/release-check/output.d.ts +0 -7
- package/dist/release-check/output.d.ts.map +0 -1
- package/dist/release-check/output.js +0 -123
- package/dist/release-check/output.js.map +0 -1
- package/dist/release-truth.d.ts +0 -20
- package/dist/release-truth.d.ts.map +0 -1
- package/dist/release-truth.js +0 -114
- package/dist/release-truth.js.map +0 -1
- package/dist/review-intelligence/baseline.d.ts +0 -58
- package/dist/review-intelligence/baseline.d.ts.map +0 -1
- package/dist/review-intelligence/baseline.js +0 -99
- package/dist/review-intelligence/baseline.js.map +0 -1
- package/dist/review-intelligence/companion-check.d.ts +0 -28
- package/dist/review-intelligence/companion-check.d.ts.map +0 -1
- package/dist/review-intelligence/companion-check.js +0 -71
- package/dist/review-intelligence/companion-check.js.map +0 -1
- package/dist/review-intelligence/detectors/architecture-graph.d.ts +0 -18
- package/dist/review-intelligence/detectors/architecture-graph.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/architecture-graph.js +0 -73
- package/dist/review-intelligence/detectors/architecture-graph.js.map +0 -1
- package/dist/review-intelligence/detectors/cjs-named-import.d.ts +0 -13
- package/dist/review-intelligence/detectors/cjs-named-import.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/cjs-named-import.js +0 -134
- package/dist/review-intelligence/detectors/cjs-named-import.js.map +0 -1
- package/dist/review-intelligence/detectors/exact-count-assertion.d.ts +0 -17
- package/dist/review-intelligence/detectors/exact-count-assertion.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/exact-count-assertion.js +0 -93
- package/dist/review-intelligence/detectors/exact-count-assertion.js.map +0 -1
- package/dist/review-intelligence/detectors/exports-map-missing.d.ts +0 -14
- package/dist/review-intelligence/detectors/exports-map-missing.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/exports-map-missing.js +0 -131
- package/dist/review-intelligence/detectors/exports-map-missing.js.map +0 -1
- package/dist/review-intelligence/detectors/fixture-keyword-drift.d.ts +0 -12
- package/dist/review-intelligence/detectors/fixture-keyword-drift.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/fixture-keyword-drift.js +0 -82
- package/dist/review-intelligence/detectors/fixture-keyword-drift.js.map +0 -1
- package/dist/review-intelligence/detectors/optional-infra-crash.d.ts +0 -12
- package/dist/review-intelligence/detectors/optional-infra-crash.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/optional-infra-crash.js +0 -97
- package/dist/review-intelligence/detectors/optional-infra-crash.js.map +0 -1
- package/dist/review-intelligence/detectors/outbound-io.d.ts +0 -14
- package/dist/review-intelligence/detectors/outbound-io.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/outbound-io.js +0 -122
- package/dist/review-intelligence/detectors/outbound-io.js.map +0 -1
- package/dist/review-intelligence/detectors/pack-rules.d.ts +0 -16
- package/dist/review-intelligence/detectors/pack-rules.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/pack-rules.js +0 -107
- package/dist/review-intelligence/detectors/pack-rules.js.map +0 -1
- package/dist/review-intelligence/detectors/platform-helpers.d.ts +0 -15
- package/dist/review-intelligence/detectors/platform-helpers.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/platform-helpers.js +0 -171
- package/dist/review-intelligence/detectors/platform-helpers.js.map +0 -1
- package/dist/review-intelligence/detectors/runtime-validation.d.ts +0 -10
- package/dist/review-intelligence/detectors/runtime-validation.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/runtime-validation.js +0 -109
- package/dist/review-intelligence/detectors/runtime-validation.js.map +0 -1
- package/dist/review-intelligence/detectors/undeclared-dependency.d.ts +0 -11
- package/dist/review-intelligence/detectors/undeclared-dependency.d.ts.map +0 -1
- package/dist/review-intelligence/detectors/undeclared-dependency.js +0 -100
- package/dist/review-intelligence/detectors/undeclared-dependency.js.map +0 -1
- package/dist/review-intelligence/engine/ast-parser.d.ts +0 -90
- package/dist/review-intelligence/engine/ast-parser.d.ts.map +0 -1
- package/dist/review-intelligence/engine/ast-parser.js +0 -266
- package/dist/review-intelligence/engine/ast-parser.js.map +0 -1
- package/dist/review-intelligence/engine/dataflow.d.ts +0 -34
- package/dist/review-intelligence/engine/dataflow.d.ts.map +0 -1
- package/dist/review-intelligence/engine/dataflow.js +0 -115
- package/dist/review-intelligence/engine/dataflow.js.map +0 -1
- package/dist/review-intelligence/engine/index.d.ts +0 -7
- package/dist/review-intelligence/engine/index.d.ts.map +0 -1
- package/dist/review-intelligence/engine/index.js +0 -7
- package/dist/review-intelligence/engine/index.js.map +0 -1
- package/dist/review-intelligence/engine/symbol-resolver.d.ts +0 -34
- package/dist/review-intelligence/engine/symbol-resolver.d.ts.map +0 -1
- package/dist/review-intelligence/engine/symbol-resolver.js +0 -106
- package/dist/review-intelligence/engine/symbol-resolver.js.map +0 -1
- package/dist/review-intelligence/fingerprint.d.ts +0 -15
- package/dist/review-intelligence/fingerprint.d.ts.map +0 -1
- package/dist/review-intelligence/fingerprint.js +0 -29
- package/dist/review-intelligence/fingerprint.js.map +0 -1
- package/dist/review-intelligence/fixes/index.d.ts +0 -54
- package/dist/review-intelligence/fixes/index.d.ts.map +0 -1
- package/dist/review-intelligence/fixes/index.js +0 -346
- package/dist/review-intelligence/fixes/index.js.map +0 -1
- package/dist/review-intelligence/index.d.ts +0 -24
- package/dist/review-intelligence/index.d.ts.map +0 -1
- package/dist/review-intelligence/index.js +0 -155
- package/dist/review-intelligence/index.js.map +0 -1
- package/dist/review-intelligence/invariants.d.ts +0 -25
- package/dist/review-intelligence/invariants.d.ts.map +0 -1
- package/dist/review-intelligence/invariants.js +0 -73
- package/dist/review-intelligence/invariants.js.map +0 -1
- package/dist/review-intelligence/learning/index.d.ts +0 -39
- package/dist/review-intelligence/learning/index.d.ts.map +0 -1
- package/dist/review-intelligence/learning/index.js +0 -265
- package/dist/review-intelligence/learning/index.js.map +0 -1
- package/dist/review-intelligence/output.d.ts +0 -31
- package/dist/review-intelligence/output.d.ts.map +0 -1
- package/dist/review-intelligence/output.js +0 -224
- package/dist/review-intelligence/output.js.map +0 -1
- package/dist/review-intelligence/packs/index.d.ts +0 -69
- package/dist/review-intelligence/packs/index.d.ts.map +0 -1
- package/dist/review-intelligence/packs/index.js +0 -168
- package/dist/review-intelligence/packs/index.js.map +0 -1
- package/dist/review-intelligence/repair-guidance.d.ts +0 -11
- package/dist/review-intelligence/repair-guidance.d.ts.map +0 -1
- package/dist/review-intelligence/repair-guidance.js +0 -137
- package/dist/review-intelligence/repair-guidance.js.map +0 -1
- package/dist/review-intelligence/severity.d.ts +0 -10
- package/dist/review-intelligence/severity.d.ts.map +0 -1
- package/dist/review-intelligence/severity.js +0 -36
- package/dist/review-intelligence/severity.js.map +0 -1
- package/dist/review-intelligence/standards-discovery.d.ts +0 -12
- package/dist/review-intelligence/standards-discovery.d.ts.map +0 -1
- package/dist/review-intelligence/standards-discovery.js +0 -221
- package/dist/review-intelligence/standards-discovery.js.map +0 -1
- package/dist/review-intelligence/suppressions.d.ts +0 -53
- package/dist/review-intelligence/suppressions.d.ts.map +0 -1
- package/dist/review-intelligence/suppressions.js +0 -86
- package/dist/review-intelligence/suppressions.js.map +0 -1
- package/dist/review-intelligence/triggers.d.ts +0 -15
- package/dist/review-intelligence/triggers.d.ts.map +0 -1
- package/dist/review-intelligence/triggers.js +0 -104
- package/dist/review-intelligence/triggers.js.map +0 -1
- package/dist/review-intelligence/types.d.ts +0 -186
- package/dist/review-intelligence/types.d.ts.map +0 -1
- package/dist/review-intelligence/types.js +0 -11
- package/dist/review-intelligence/types.js.map +0 -1
- package/dist/risk-detection/heuristics.d.ts +0 -13
- package/dist/risk-detection/heuristics.d.ts.map +0 -1
- package/dist/risk-detection/heuristics.js +0 -348
- package/dist/risk-detection/heuristics.js.map +0 -1
- package/dist/risk-detection/index.d.ts +0 -20
- package/dist/risk-detection/index.d.ts.map +0 -1
- package/dist/risk-detection/index.js +0 -128
- package/dist/risk-detection/index.js.map +0 -1
- package/dist/security/export-sanitizer.d.ts +0 -76
- package/dist/security/export-sanitizer.d.ts.map +0 -1
- package/dist/security/export-sanitizer.js +0 -176
- package/dist/security/export-sanitizer.js.map +0 -1
- package/dist/security/path-summary.d.ts +0 -4
- package/dist/security/path-summary.d.ts.map +0 -1
- package/dist/security/path-summary.js +0 -94
- package/dist/security/path-summary.js.map +0 -1
- package/dist/session-id.d.ts +0 -22
- package/dist/session-id.d.ts.map +0 -1
- package/dist/session-id.js +0 -49
- package/dist/session-id.js.map +0 -1
- package/dist/session-paths.d.ts +0 -35
- package/dist/session-paths.d.ts.map +0 -1
- package/dist/session-paths.js +0 -68
- package/dist/session-paths.js.map +0 -1
- package/dist/session-registry.d.ts +0 -19
- package/dist/session-registry.d.ts.map +0 -1
- package/dist/session-registry.js +0 -182
- package/dist/session-registry.js.map +0 -1
- package/dist/session-timeline.d.ts +0 -13
- package/dist/session-timeline.d.ts.map +0 -1
- package/dist/session-timeline.js +0 -134
- package/dist/session-timeline.js.map +0 -1
- package/dist/signing/canonicalize.d.ts +0 -17
- package/dist/signing/canonicalize.d.ts.map +0 -1
- package/dist/signing/canonicalize.js +0 -50
- package/dist/signing/canonicalize.js.map +0 -1
- package/dist/signing/hmac.d.ts +0 -8
- package/dist/signing/hmac.d.ts.map +0 -1
- package/dist/signing/hmac.js +0 -16
- package/dist/signing/hmac.js.map +0 -1
- package/dist/signing/signer.d.ts +0 -16
- package/dist/signing/signer.d.ts.map +0 -1
- package/dist/signing/signer.js +0 -2
- package/dist/signing/signer.js.map +0 -1
- package/dist/templates/claude-md.d.ts +0 -12
- package/dist/templates/claude-md.d.ts.map +0 -1
- package/dist/templates/claude-md.js +0 -113
- package/dist/templates/claude-md.js.map +0 -1
- package/dist/templates/config.d.ts +0 -3
- package/dist/templates/config.d.ts.map +0 -1
- package/dist/templates/config.js +0 -154
- package/dist/templates/config.js.map +0 -1
- package/dist/templates/harness-pack.d.ts +0 -3
- package/dist/templates/harness-pack.d.ts.map +0 -1
- package/dist/templates/harness-pack.js +0 -26
- package/dist/templates/harness-pack.js.map +0 -1
- package/dist/templates/hooks.d.ts +0 -36
- package/dist/templates/hooks.d.ts.map +0 -1
- package/dist/templates/hooks.js +0 -278
- package/dist/templates/hooks.js.map +0 -1
- package/dist/templates/runtime-resolution.d.ts +0 -4
- package/dist/templates/runtime-resolution.d.ts.map +0 -1
- package/dist/templates/runtime-resolution.js +0 -76
- package/dist/templates/runtime-resolution.js.map +0 -1
- package/dist/templates/scenarios.d.ts +0 -3
- package/dist/templates/scenarios.d.ts.map +0 -1
- package/dist/templates/scenarios.js +0 -335
- package/dist/templates/scenarios.js.map +0 -1
- package/dist/utils/two-loop.d.ts +0 -36
- package/dist/utils/two-loop.d.ts.map +0 -1
- package/dist/utils/two-loop.js +0 -75
- package/dist/utils/two-loop.js.map +0 -1
- package/dist/utils/upgrade-nudge.d.ts +0 -18
- package/dist/utils/upgrade-nudge.d.ts.map +0 -1
- package/dist/utils/upgrade-nudge.js +0 -57
- package/dist/utils/upgrade-nudge.js.map +0 -1
- package/dist/verify/evaluate.d.ts +0 -10
- package/dist/verify/evaluate.d.ts.map +0 -1
- package/dist/verify/evaluate.js +0 -117
- package/dist/verify/evaluate.js.map +0 -1
- package/dist/verify/insertion-point-lock.d.ts +0 -12
- package/dist/verify/insertion-point-lock.d.ts.map +0 -1
- package/dist/verify/insertion-point-lock.js +0 -208
- package/dist/verify/insertion-point-lock.js.map +0 -1
- package/dist/verify/policy-snapshot.d.ts +0 -7
- package/dist/verify/policy-snapshot.d.ts.map +0 -1
- package/dist/verify/policy-snapshot.js +0 -36
- package/dist/verify/policy-snapshot.js.map +0 -1
- package/dist/verify/report.d.ts +0 -11
- package/dist/verify/report.d.ts.map +0 -1
- package/dist/verify/report.js +0 -64
- package/dist/verify/report.js.map +0 -1
- package/dist/verify/symbol-growth.d.ts +0 -13
- package/dist/verify/symbol-growth.d.ts.map +0 -1
- package/dist/verify/symbol-growth.js +0 -143
- package/dist/verify/symbol-growth.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -11
- package/dist/version.js.map +0 -1
|
@@ -1,1413 +0,0 @@
|
|
|
1
|
-
import { readFileSync, existsSync, readdirSync, statSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { execSync } from 'node:child_process';
|
|
4
|
-
import { intentNorm } from '@codeledger/selector';
|
|
5
|
-
import { resolveSessionId } from '../session-id.js';
|
|
6
|
-
import { sessionActivateRef, sessionStartRef, sessionTaskHistoryPath, sessionReadLogPath, sessionReviewConfigPath, } from '../session-paths.js';
|
|
7
|
-
import { countCheckpoints } from './checkpoint.js';
|
|
8
|
-
import { evaluateDrift } from './intent.js';
|
|
9
|
-
import { loadReadTracker } from './review-coverage.js';
|
|
10
|
-
import { detectLedgerAdmission } from '../prompt-coach/admission.js';
|
|
11
|
-
import { writeSessionEvidence, writeEpisodeRecord } from '../ecl/persistence.js';
|
|
12
|
-
import { recordPatternReuse, refreshPatternScore, shouldRetire, detectAntiPatterns, writeAntiPattern } from '../ecl/lifecycle.js';
|
|
13
|
-
import { loadPromotedPatterns, writePromotedPattern } from '../ecl/persistence.js';
|
|
14
|
-
import { analyzeSessionDensity, generatePatternCandidate } from '@codeledger/engine';
|
|
15
|
-
import { tagSensitiveLines } from '../merge-check/hallucination-guard.js';
|
|
16
|
-
import { releaseSession } from '../merge-check/intent-registry.js';
|
|
17
|
-
import { generateExecutionSummary, formatExecutionSummary, formatExecutionSummaryCI, buildSummaryEvent, detectImplicitSignals, askFeedback, recordSummaryEvent, } from '../prompt-coach/index.js';
|
|
18
|
-
/**
|
|
19
|
-
* `codeledger session-summary [--session <id>]`
|
|
20
|
-
*
|
|
21
|
-
* Lightweight session-end value report. Compares the active context bundle
|
|
22
|
-
* against files actually changed during the session, producing a concise
|
|
23
|
-
* recap that reinforces the value of deterministic context selection.
|
|
24
|
-
*
|
|
25
|
-
* Designed to be called from the Claude Code Stop hook.
|
|
26
|
-
*
|
|
27
|
-
* Multi-session: when a session ID is provided, reads refs from the
|
|
28
|
-
* session-specific directory instead of the shared .codeledger/ root.
|
|
29
|
-
*/
|
|
30
|
-
export async function runSessionSummary(cwd, flags) {
|
|
31
|
-
const configPath = join(cwd, '.codeledger', 'config.json');
|
|
32
|
-
if (!existsSync(configPath)) {
|
|
33
|
-
if (flags['quiet'] !== 'true') {
|
|
34
|
-
console.log('No .codeledger/ found. Run "codeledger init" first.');
|
|
35
|
-
}
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
let config;
|
|
39
|
-
try {
|
|
40
|
-
config = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
// Malformed config — exit silently (don't pollute agent output from hook)
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const sessionId = resolveSessionId({ session: flags['session'] });
|
|
47
|
-
// ── Find the latest bundle artifact ─────────────────────────────────────
|
|
48
|
-
const bundle = loadLatestBundle(cwd, config);
|
|
49
|
-
if (!bundle) {
|
|
50
|
-
// No bundle was generated this session — nothing to summarize
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
// ── Gather actual file changes from git ─────────────────────────────────
|
|
54
|
-
const filesChanged = getSessionChangedFiles(cwd, sessionId);
|
|
55
|
-
if (filesChanged.length === 0) {
|
|
56
|
-
console.log('CodeLedger: no files changed this session — nothing to recap.');
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
// ── Compute overlap metrics ─────────────────────────────────────────────
|
|
60
|
-
const bundleFiles = bundle.files.map((f) => f.path);
|
|
61
|
-
const overlap = filesChanged.filter((f) => bundleFiles.includes(f));
|
|
62
|
-
const regretFiles = filesChanged.filter((f) => !bundleFiles.includes(f));
|
|
63
|
-
const recall = filesChanged.length > 0
|
|
64
|
-
? overlap.length / filesChanged.length
|
|
65
|
-
: 0;
|
|
66
|
-
const precision = bundleFiles.length > 0
|
|
67
|
-
? overlap.length / bundleFiles.length
|
|
68
|
-
: 0;
|
|
69
|
-
// ── Split recall: edit-recall vs creation-recall ──────────────────────
|
|
70
|
-
// Files that existed before the session (edits) vs files that were created
|
|
71
|
-
// during the session (new). Only edit-recall is meaningful — bundles
|
|
72
|
-
// can't predict files that don't exist yet.
|
|
73
|
-
const { editedFiles, createdFiles } = classifyEditedVsCreated(cwd, filesChanged, sessionId);
|
|
74
|
-
// ── Estimate repo-wide token count for context reduction ────────────────
|
|
75
|
-
const repoTokens = estimateRepoTokens(cwd, config);
|
|
76
|
-
const reductionPct = repoTokens > 0
|
|
77
|
-
? ((repoTokens - bundle.total_tokens) / repoTokens) * 100
|
|
78
|
-
: 0;
|
|
79
|
-
// ── Debt injection detection ─────────────────────────────────────────────
|
|
80
|
-
const debt = analyzeDebt(cwd, sessionId);
|
|
81
|
-
// ── Commit hygiene analysis ─────────────────────────────────────────────
|
|
82
|
-
const commitHygiene = analyzeCommitHygiene(cwd, sessionId, bundleFiles);
|
|
83
|
-
// ── Scope drift detection ─────────────────────────────────────────────
|
|
84
|
-
const scopeDriftFiles = bundle.scope_contract
|
|
85
|
-
? getScopeDriftFiles(filesChanged, bundle.scope_contract)
|
|
86
|
-
: [];
|
|
87
|
-
const scopeDriftCount = scopeDriftFiles.length > 0 ? scopeDriftFiles.length : undefined;
|
|
88
|
-
// ── Conflict zone touches ─────────────────────────────────────────────
|
|
89
|
-
const conflictZoneTouches = bundle.conflict_zones
|
|
90
|
-
? countConflictTouches(filesChanged, bundle.conflict_zones)
|
|
91
|
-
: undefined;
|
|
92
|
-
// ── Bundle invalidation (commit-aware staleness) ──────────────────────
|
|
93
|
-
const bundleInvalidation = analyzeBundleInvalidation(cwd, sessionId, bundleFiles);
|
|
94
|
-
// ── Checkpoint count ──────────────────────────────────────────────────
|
|
95
|
-
const checkpointCount = countCheckpoints(cwd, sessionId);
|
|
96
|
-
// ── Review coverage (Sentinel) ───────────────────────────────────────
|
|
97
|
-
let reviewCoverage;
|
|
98
|
-
const reviewConfigPath = sessionReviewConfigPath(cwd, sessionId);
|
|
99
|
-
if (existsSync(reviewConfigPath)) {
|
|
100
|
-
try {
|
|
101
|
-
const reviewConfig = JSON.parse(readFileSync(reviewConfigPath, 'utf-8'));
|
|
102
|
-
const indexPath = join(cwd, config.workspace.cache_dir, 'repo-index.json');
|
|
103
|
-
if (existsSync(indexPath)) {
|
|
104
|
-
const ridx = JSON.parse(readFileSync(indexPath, 'utf-8'));
|
|
105
|
-
const readLogPath = sessionReadLogPath(cwd, sessionId);
|
|
106
|
-
const tracker = loadReadTracker(readLogPath, ridx);
|
|
107
|
-
const { computeReviewCoverage } = await import('@codeledger/selector');
|
|
108
|
-
const allRequired = [...reviewConfig.must_read_files, ...reviewConfig.should_read_files];
|
|
109
|
-
reviewCoverage = computeReviewCoverage(allRequired, tracker.getAllDepths(), tracker.getReadPaths(), ridx);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
catch {
|
|
113
|
-
// Non-fatal: review coverage is optional enrichment
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
// Compute edit-recall: recall only over files that existed pre-session
|
|
117
|
-
const editOverlap = editedFiles.filter((f) => bundleFiles.includes(f));
|
|
118
|
-
const editRecall = editedFiles.length > 0
|
|
119
|
-
? editOverlap.length / editedFiles.length
|
|
120
|
-
: 0;
|
|
121
|
-
const summary = {
|
|
122
|
-
bundle_id: bundle.bundle_id,
|
|
123
|
-
task: bundle.task,
|
|
124
|
-
bundle_files: bundleFiles,
|
|
125
|
-
files_changed: filesChanged,
|
|
126
|
-
files_overlapping: overlap,
|
|
127
|
-
recall,
|
|
128
|
-
precision,
|
|
129
|
-
edit_recall: editRecall,
|
|
130
|
-
created_file_count: createdFiles.length,
|
|
131
|
-
bundle_tokens: bundle.total_tokens,
|
|
132
|
-
repo_total_tokens: repoTokens,
|
|
133
|
-
context_reduction_pct: reductionPct,
|
|
134
|
-
generated_at: new Date().toISOString(),
|
|
135
|
-
session_id: sessionId ?? undefined,
|
|
136
|
-
debt: debt ?? undefined,
|
|
137
|
-
commit_hygiene: commitHygiene ?? undefined,
|
|
138
|
-
scope_drift_count: scopeDriftCount,
|
|
139
|
-
conflict_zone_touches: conflictZoneTouches,
|
|
140
|
-
checkpoint_count: checkpointCount > 0 ? checkpointCount : undefined,
|
|
141
|
-
bundle_invalidation: bundleInvalidation ?? undefined,
|
|
142
|
-
review_coverage: reviewCoverage,
|
|
143
|
-
regret_files: regretFiles.length > 0 ? regretFiles : undefined,
|
|
144
|
-
regret_ratio: filesChanged.length > 0 ? regretFiles.length / filesChanged.length : undefined,
|
|
145
|
-
};
|
|
146
|
-
// ── Intent drift evaluation ───────────────────────────────────────────
|
|
147
|
-
const intentDrift = evaluateDrift(cwd, sessionId);
|
|
148
|
-
// ── Implicit feedback capture ──────────────────────────────────────────
|
|
149
|
-
detectImplicitSignals(cwd, sessionId, scopeDriftCount ?? 0, summary.regret_ratio ?? 0, summary.recall);
|
|
150
|
-
// ── Execution summary (Prompt Coach post-execution) ────────────────────
|
|
151
|
-
const isFinal = flags['final'] === 'true';
|
|
152
|
-
const quiet = flags['quiet'] === 'true';
|
|
153
|
-
// Detect reused patterns from bundle reasons
|
|
154
|
-
const reusedPattern = detectReusedPattern(bundle);
|
|
155
|
-
// Detect ledger admission outcome (the execution/persistence distinction)
|
|
156
|
-
const ledgerAdmission = detectLedgerAdmission(cwd, summary);
|
|
157
|
-
const execSummary = generateExecutionSummary({
|
|
158
|
-
sessionSummary: summary,
|
|
159
|
-
bundle,
|
|
160
|
-
ledgerAdmission,
|
|
161
|
-
isFinal,
|
|
162
|
-
scopeDriftCount: scopeDriftCount ?? 0,
|
|
163
|
-
intentDriftLevel: intentDrift?.drift?.drift_level,
|
|
164
|
-
reusedPattern,
|
|
165
|
-
});
|
|
166
|
-
// Print execution summary (replaces verbose recap for prompt-coach users)
|
|
167
|
-
const isCI = process.env['CI'] === 'true' || process.env['CI'] === '1';
|
|
168
|
-
if (!quiet) {
|
|
169
|
-
if (isCI) {
|
|
170
|
-
console.log(formatExecutionSummaryCI(execSummary));
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
console.log(formatExecutionSummary(execSummary));
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
// Explicit feedback (only on final, only if interactive, only if warranted)
|
|
177
|
-
let feedbackResponse = null;
|
|
178
|
-
if (execSummary.askFeedback && execSummary.feedbackQuestion && isFinal && !quiet && !isCI) {
|
|
179
|
-
feedbackResponse = await askFeedback(execSummary.feedbackQuestion);
|
|
180
|
-
}
|
|
181
|
-
// Record telemetry
|
|
182
|
-
const summaryEvent = buildSummaryEvent(execSummary, feedbackResponse, sessionId ?? undefined);
|
|
183
|
-
recordSummaryEvent(cwd, sessionId, summaryEvent);
|
|
184
|
-
// ── Write ECL evidence (💎 Next becomes real) ──────────────────────────
|
|
185
|
-
const hasCoachEvents = (() => {
|
|
186
|
-
try {
|
|
187
|
-
const { existsSync: ex } = require('node:fs');
|
|
188
|
-
const { join: j } = require('node:path');
|
|
189
|
-
const coachDir = sessionId
|
|
190
|
-
? j(cwd, '.codeledger', 'sessions', sessionId)
|
|
191
|
-
: j(cwd, '.codeledger');
|
|
192
|
-
return ex(j(coachDir, '.coach-events.jsonl'));
|
|
193
|
-
}
|
|
194
|
-
catch {
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
197
|
-
})();
|
|
198
|
-
let evidencePath;
|
|
199
|
-
let episodePath;
|
|
200
|
-
try {
|
|
201
|
-
evidencePath = writeSessionEvidence(cwd, sessionId, summary, bundle, hasCoachEvents);
|
|
202
|
-
}
|
|
203
|
-
catch { /* non-fatal */ }
|
|
204
|
-
// Episode generation only on --final (session end)
|
|
205
|
-
if (isFinal) {
|
|
206
|
-
try {
|
|
207
|
-
episodePath = writeEpisodeRecord(cwd, sessionId, summary);
|
|
208
|
-
}
|
|
209
|
-
catch { /* non-fatal */ }
|
|
210
|
-
}
|
|
211
|
-
// ── IQO analysis: distill session density for pattern promotion ─────────
|
|
212
|
-
if (isFinal && summary.recall >= 0.5) {
|
|
213
|
-
try {
|
|
214
|
-
const bundleFiles = bundle.files.map((f) => f.path);
|
|
215
|
-
const iqoResult = analyzeSessionDensity(bundleFiles, summary.files_changed, bundle.total_tokens);
|
|
216
|
-
if (iqoResult.promotionEligible) {
|
|
217
|
-
const candidate = generatePatternCandidate(summary.task, iqoResult, bundle.task_type);
|
|
218
|
-
writePromotedPattern(cwd, candidate, iqoResult.anchorFiles);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
catch { /* non-fatal: IQO is best-effort */ }
|
|
222
|
-
}
|
|
223
|
-
// ── Semantic Fortress: tag sensitive lines on successful sessions ──────
|
|
224
|
-
if (isFinal && summary.recall >= 0.5 && summary.files_changed.length > 0) {
|
|
225
|
-
try {
|
|
226
|
-
tagSensitiveLines(cwd, sessionId ?? 'default', summary.task, summary.files_changed);
|
|
227
|
-
}
|
|
228
|
-
catch { /* non-fatal */ }
|
|
229
|
-
}
|
|
230
|
-
// ── Semantic Fortress: release session lock on final summary ───────────
|
|
231
|
-
if (isFinal) {
|
|
232
|
-
try {
|
|
233
|
-
releaseSession(cwd, sessionId ?? 'default');
|
|
234
|
-
}
|
|
235
|
-
catch { /* non-fatal */ }
|
|
236
|
-
}
|
|
237
|
-
// ── Pattern reuse outcome linking (closes the feedback loop) ───────────
|
|
238
|
-
let patternsStrengthened = 0;
|
|
239
|
-
let patternsWeakened = 0;
|
|
240
|
-
try {
|
|
241
|
-
const activePatternPath = join(sessionId ? join(cwd, '.codeledger', 'sessions', sessionId) : join(cwd, '.codeledger'), '.active-patterns.json');
|
|
242
|
-
if (existsSync(activePatternPath)) {
|
|
243
|
-
const activePatterns = JSON.parse(readFileSync(activePatternPath, 'utf-8'));
|
|
244
|
-
const sessionOutcome = summary.recall >= 0.5 ? 'success' : summary.recall > 0 ? 'partial' : 'failure';
|
|
245
|
-
for (const ap of activePatterns) {
|
|
246
|
-
recordPatternReuse(cwd, ap.id, {
|
|
247
|
-
episodeId: sessionId ?? 'default',
|
|
248
|
-
task: summary.task,
|
|
249
|
-
outcome: sessionOutcome,
|
|
250
|
-
reusedAt: new Date().toISOString(),
|
|
251
|
-
});
|
|
252
|
-
if (sessionOutcome === 'success')
|
|
253
|
-
patternsStrengthened++;
|
|
254
|
-
else if (sessionOutcome === 'failure')
|
|
255
|
-
patternsWeakened++;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
catch { /* non-fatal */ }
|
|
260
|
-
// ── Pattern lifecycle: retirement + anti-pattern detection (on --final) ──
|
|
261
|
-
let patternsRetired = 0;
|
|
262
|
-
let antiPatternsDetected = 0;
|
|
263
|
-
if (isFinal) {
|
|
264
|
-
try {
|
|
265
|
-
const allPatterns = loadPromotedPatterns(cwd);
|
|
266
|
-
const scoredPatterns = allPatterns.map((p) => refreshPatternScore(cwd, p));
|
|
267
|
-
// Check for patterns that should retire
|
|
268
|
-
for (const sp of scoredPatterns) {
|
|
269
|
-
if (sp.score && shouldRetire(sp.score) && sp.score.status !== 'retired') {
|
|
270
|
-
sp.score.status = 'retired';
|
|
271
|
-
// Write updated pattern back to disk
|
|
272
|
-
const { writeFileSync: wfs } = require('node:fs');
|
|
273
|
-
const { join: j } = require('node:path');
|
|
274
|
-
const patternPath = j(cwd, '.codeledger', 'patterns', `${sp.id}.json`);
|
|
275
|
-
if (existsSync(patternPath)) {
|
|
276
|
-
wfs(patternPath, JSON.stringify({ ...sp, score: sp.score }, null, 2) + '\n');
|
|
277
|
-
patternsRetired++;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
// Detect anti-patterns from retired patterns
|
|
282
|
-
const retiredWithScores = scoredPatterns.filter((p) => p.score?.status === 'retired');
|
|
283
|
-
const antiPatterns = detectAntiPatterns(retiredWithScores);
|
|
284
|
-
for (const ap of antiPatterns) {
|
|
285
|
-
try {
|
|
286
|
-
writeAntiPattern(cwd, ap);
|
|
287
|
-
antiPatternsDetected++;
|
|
288
|
-
}
|
|
289
|
-
catch { /* non-fatal */ }
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
catch { /* non-fatal: lifecycle analysis should never break session end */ }
|
|
293
|
-
}
|
|
294
|
-
// ── Session-wide aggregate (only on --final, i.e. Stop hook) ───────────
|
|
295
|
-
// Print the per-task breakdown FIRST when --final is set, so the most
|
|
296
|
-
// useful information appears at the top (Fix 3.1)
|
|
297
|
-
if (isFinal) {
|
|
298
|
-
printSessionAggregate(cwd, sessionId, summary);
|
|
299
|
-
}
|
|
300
|
-
// ── Extract shadow files from bundle ────────────────────────────────────
|
|
301
|
-
const shadowFiles = bundle.files.filter((f) => f.shadow_reason);
|
|
302
|
-
// ── Print concise recap ─────────────────────────────────────────────────
|
|
303
|
-
const measuredValue = loadMeasuredBenchmarkValue(cwd, bundle.task);
|
|
304
|
-
printRecap(summary, intentDrift, scopeDriftFiles, config.suggestions?.prefill_task === true, shadowFiles, bundle.task_type, measuredValue);
|
|
305
|
-
// ── 📂 Memory written — show developers where evidence lives ──────────
|
|
306
|
-
if (!quiet) {
|
|
307
|
-
const memLines = [];
|
|
308
|
-
memLines.push('');
|
|
309
|
-
memLines.push(' \uD83D\uDCC2 Memory written');
|
|
310
|
-
if (evidencePath) {
|
|
311
|
-
memLines.push(` Evidence: ${evidencePath.replace(cwd + '/', '')}`);
|
|
312
|
-
}
|
|
313
|
-
if (episodePath) {
|
|
314
|
-
memLines.push(` Episode: ${episodePath.replace(cwd + '/', '')}`);
|
|
315
|
-
}
|
|
316
|
-
memLines.push(' Patterns: .codeledger/patterns/');
|
|
317
|
-
if (patternsStrengthened > 0 || patternsWeakened > 0) {
|
|
318
|
-
memLines.push('');
|
|
319
|
-
memLines.push(' \uD83D\uDC8E Pattern lifecycle');
|
|
320
|
-
if (patternsStrengthened > 0) {
|
|
321
|
-
memLines.push(` ${patternsStrengthened} pattern${patternsStrengthened > 1 ? 's' : ''} strengthened by successful outcome`);
|
|
322
|
-
}
|
|
323
|
-
if (patternsWeakened > 0) {
|
|
324
|
-
memLines.push(` ${patternsWeakened} pattern${patternsWeakened > 1 ? 's' : ''} weakened by failure`);
|
|
325
|
-
}
|
|
326
|
-
if (patternsRetired > 0) {
|
|
327
|
-
memLines.push(` ${patternsRetired} pattern${patternsRetired > 1 ? 's' : ''} retired (repeated failure)`);
|
|
328
|
-
}
|
|
329
|
-
if (antiPatternsDetected > 0) {
|
|
330
|
-
memLines.push(` ${antiPatternsDetected} anti-pattern${antiPatternsDetected > 1 ? 's' : ''} detected`);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
memLines.push('');
|
|
334
|
-
console.log(memLines.join('\n'));
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
function loadLatestBundle(cwd, config) {
|
|
338
|
-
const bundleDir = join(cwd, config.workspace.artifacts_dir, 'bundles');
|
|
339
|
-
if (!existsSync(bundleDir))
|
|
340
|
-
return null;
|
|
341
|
-
const files = readdirSync(bundleDir)
|
|
342
|
-
.filter((f) => f.endsWith('.json'))
|
|
343
|
-
.map((f) => ({
|
|
344
|
-
name: f,
|
|
345
|
-
mtime: statSync(join(bundleDir, f)).mtimeMs,
|
|
346
|
-
}))
|
|
347
|
-
.sort((a, b) => b.mtime - a.mtime);
|
|
348
|
-
if (files.length === 0)
|
|
349
|
-
return null;
|
|
350
|
-
const latestPath = join(bundleDir, files[0].name);
|
|
351
|
-
try {
|
|
352
|
-
return JSON.parse(readFileSync(latestPath, 'utf-8'));
|
|
353
|
-
}
|
|
354
|
-
catch {
|
|
355
|
-
// Corrupted or deleted bundle file — treat as missing
|
|
356
|
-
return null;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
function getSessionChangedFiles(cwd, sessionId) {
|
|
360
|
-
try {
|
|
361
|
-
const files = new Set();
|
|
362
|
-
// 1. Uncommitted changes (staged + unstaged)
|
|
363
|
-
const diffOutput = execSync('git diff --name-only HEAD', {
|
|
364
|
-
cwd,
|
|
365
|
-
encoding: 'utf-8',
|
|
366
|
-
timeout: 5000,
|
|
367
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
368
|
-
}).trim();
|
|
369
|
-
if (diffOutput) {
|
|
370
|
-
for (const f of diffOutput.split('\n'))
|
|
371
|
-
files.add(f);
|
|
372
|
-
}
|
|
373
|
-
// 2. Untracked files
|
|
374
|
-
const untrackedOutput = execSync('git ls-files --others --exclude-standard', {
|
|
375
|
-
cwd,
|
|
376
|
-
encoding: 'utf-8',
|
|
377
|
-
timeout: 5000,
|
|
378
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
379
|
-
}).trim();
|
|
380
|
-
if (untrackedOutput) {
|
|
381
|
-
for (const f of untrackedOutput.split('\n'))
|
|
382
|
-
files.add(f);
|
|
383
|
-
}
|
|
384
|
-
// 3. Committed changes: prefer .activate-ref (scoped to current task)
|
|
385
|
-
// over .session-start-ref (full session) for accurate per-task metrics
|
|
386
|
-
// Use session-specific paths when a session ID is available
|
|
387
|
-
const activateRefPath = sessionActivateRef(cwd, sessionId);
|
|
388
|
-
const sessionRefPath = sessionStartRef(cwd, sessionId);
|
|
389
|
-
const refPath = existsSync(activateRefPath) ? activateRefPath : sessionRefPath;
|
|
390
|
-
if (existsSync(refPath)) {
|
|
391
|
-
const startRef = readFileSync(refPath, 'utf-8').trim();
|
|
392
|
-
if (startRef) {
|
|
393
|
-
try {
|
|
394
|
-
const committedDiff = execSync(`git diff --name-only ${startRef}..HEAD`, { cwd, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
395
|
-
if (committedDiff) {
|
|
396
|
-
for (const f of committedDiff.split('\n'))
|
|
397
|
-
files.add(f);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
catch {
|
|
401
|
-
// startRef may no longer be valid (rebased away, etc.) — non-fatal
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return [...files].filter((f) => !f.startsWith('.codeledger/') && !f.startsWith('.claude/'));
|
|
406
|
-
}
|
|
407
|
-
catch {
|
|
408
|
-
return [];
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Detect if the bundle leveraged a known reusable pattern.
|
|
413
|
-
* Looks for pattern_exemplar reasons in bundle files.
|
|
414
|
-
*/
|
|
415
|
-
function detectReusedPattern(bundle) {
|
|
416
|
-
const exemplars = bundle.files.filter((f) => f.reasons.includes('pattern_exemplar'));
|
|
417
|
-
if (exemplars.length === 0)
|
|
418
|
-
return undefined;
|
|
419
|
-
// Extract a short label from the first exemplar's path
|
|
420
|
-
const firstPath = exemplars[0].path;
|
|
421
|
-
const parts = firstPath.split('/');
|
|
422
|
-
// Use last 2 path segments as label (e.g., "auth/middleware")
|
|
423
|
-
return parts.length >= 2 ? parts.slice(-2).join('/') : firstPath;
|
|
424
|
-
}
|
|
425
|
-
function estimateRepoTokens(cwd, config) {
|
|
426
|
-
const indexPath = join(cwd, config.workspace.cache_dir, 'repo-index.json');
|
|
427
|
-
if (!existsSync(indexPath))
|
|
428
|
-
return 0;
|
|
429
|
-
try {
|
|
430
|
-
const repoIndex = JSON.parse(readFileSync(indexPath, 'utf-8'));
|
|
431
|
-
// Use same heuristic as selector stop-rule: 4 tokens per line
|
|
432
|
-
return repoIndex.files.reduce((sum, f) => sum + f.lines * 4, 0);
|
|
433
|
-
}
|
|
434
|
-
catch {
|
|
435
|
-
return 0;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
function printRecap(s, intentDrift, scopeDriftFiles, prefillTask, shadowFiles, taskType, measuredValue) {
|
|
439
|
-
const recallPct = Math.round(s.recall * 100);
|
|
440
|
-
const precisionPct = Math.round(s.precision * 100);
|
|
441
|
-
const reductionPct = Math.round(s.context_reduction_pct);
|
|
442
|
-
const isRepoScan = taskType === 'repo_scan';
|
|
443
|
-
// F1 score: harmonic mean of precision and recall — single usefulness metric
|
|
444
|
-
const f1 = (s.precision + s.recall) > 0
|
|
445
|
-
? 2 * (s.precision * s.recall) / (s.precision + s.recall)
|
|
446
|
-
: 0;
|
|
447
|
-
const valueStatement = measuredValue
|
|
448
|
-
? null
|
|
449
|
-
: formatValueStatement(s.bundle_tokens, s.repo_total_tokens, 1);
|
|
450
|
-
const lines = [];
|
|
451
|
-
lines.push('');
|
|
452
|
-
lines.push('-- CodeLedger Session Recap ----------------------------------');
|
|
453
|
-
if (s.session_id) {
|
|
454
|
-
lines.push(` Session: ${s.session_id}`);
|
|
455
|
-
}
|
|
456
|
-
// Task shape annotation for repo_scan
|
|
457
|
-
if (isRepoScan) {
|
|
458
|
-
lines.push(` Task shape: repo_scan (broad/mechanical)`);
|
|
459
|
-
}
|
|
460
|
-
if (isRepoScan) {
|
|
461
|
-
// repo_scan-specific messaging — low recall is expected, not a failure
|
|
462
|
-
lines.push(` Bundle predicted ${s.files_overlapping.length}/${s.files_changed.length} files you changed (${recallPct}% recall)`);
|
|
463
|
-
lines.push(` Bundle accuracy: ${s.files_overlapping.length}/${s.bundle_files.length} bundled files were relevant (${precisionPct}% precision)`);
|
|
464
|
-
lines.push(` Assessment: repo_scan task — bundle includes validator + representative targets; scope drift is expected.`);
|
|
465
|
-
lines.push(` Task breadth: ${s.files_changed.length} files touched`);
|
|
466
|
-
}
|
|
467
|
-
else if (f1 < 0.3) {
|
|
468
|
-
// Bundle was not useful — diagnose why
|
|
469
|
-
lines.push(` Bundle missed: predicted ${s.files_overlapping.length}/${s.files_changed.length} files you changed (${recallPct}% recall)`);
|
|
470
|
-
lines.push(` Bundle accuracy: ${s.files_overlapping.length}/${s.bundle_files.length} bundled files were relevant (${precisionPct}% precision)`);
|
|
471
|
-
// Classify the session pattern to give actionable advice
|
|
472
|
-
const sessionPattern = classifySessionPattern(s.files_changed);
|
|
473
|
-
if (sessionPattern.isInfrastructure) {
|
|
474
|
-
lines.push(` Pattern: infrastructure/ops session — ${sessionPattern.infraFileCount} of ${s.files_changed.length} files are infra (migrations, docker, scripts, k8s, terraform).`);
|
|
475
|
-
lines.push(` Assessment: Bundle recall is not meaningful for infrastructure tasks. Bundles target source code edits.`);
|
|
476
|
-
}
|
|
477
|
-
else if (sessionPattern.newFileRatio > 0.5) {
|
|
478
|
-
lines.push(` Pattern: exploratory session — ${sessionPattern.newFileCount} of ${s.files_changed.length} files were created (not predictable).`);
|
|
479
|
-
lines.push(` Tip: Bundles work best for focused edits to existing code. For scaffolding/new-file tasks, low recall is expected.`);
|
|
480
|
-
}
|
|
481
|
-
else if (s.files_changed.length > 50) {
|
|
482
|
-
lines.push(` Pattern: broad session (${s.files_changed.length} files touched). Bundle targets focused tasks.`);
|
|
483
|
-
lines.push(` Tip: For multi-phase work, refresh the bundle between phases: "codeledger activate --task \\"...\\"".`);
|
|
484
|
-
}
|
|
485
|
-
else if (s.recall === 0 && s.precision > 0) {
|
|
486
|
-
// Zero recall but bundle had files — work diverged from task
|
|
487
|
-
lines.push(` Pattern: work diverged from task — none of the ${s.files_changed.length} files you touched were in the bundle.`);
|
|
488
|
-
lines.push(` This often means the task changed mid-session. The bundle may have been correct for the original intent.`);
|
|
489
|
-
lines.push(` Tip: Refresh with "codeledger activate --task \\"your current goal\\"" when changing direction.`);
|
|
490
|
-
}
|
|
491
|
-
else {
|
|
492
|
-
lines.push(` The bundle was not useful for this task.`);
|
|
493
|
-
lines.push(` Tip: Re-run "codeledger activate --task ${prefillTask ? `"${s.task}"` : '...'}" with a more specific task description.`);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
else if (s.recall < 0.5) {
|
|
497
|
-
// Bundle was partially useful — show all stats but highlight room to improve
|
|
498
|
-
lines.push(` Bundle predicted ${s.files_overlapping.length}/${s.files_changed.length} files you changed (${recallPct}% recall)`);
|
|
499
|
-
lines.push(` Bundle accuracy: ${s.files_overlapping.length}/${s.bundle_files.length} bundled files were relevant (${precisionPct}% precision)`);
|
|
500
|
-
lines.push(` Context: ~${fmtTokens(s.bundle_tokens)} tokens vs ~${fmtTokens(s.repo_total_tokens)} full repo (${reductionPct}% reduction)`);
|
|
501
|
-
lines.push(` Tip: A more specific task description may improve recall.`);
|
|
502
|
-
}
|
|
503
|
-
else {
|
|
504
|
-
// Bundle worked well — show the full value story
|
|
505
|
-
lines.push(` Bundle predicted ${s.files_overlapping.length}/${s.files_changed.length} files you changed (${recallPct}% recall)`);
|
|
506
|
-
lines.push(` Bundle accuracy: ${s.files_overlapping.length}/${s.bundle_files.length} bundled files were relevant (${precisionPct}% precision)`);
|
|
507
|
-
lines.push(` Context: ~${fmtTokens(s.bundle_tokens)} tokens vs ~${fmtTokens(s.repo_total_tokens)} full repo (${reductionPct}% reduction)`);
|
|
508
|
-
}
|
|
509
|
-
if (measuredValue) {
|
|
510
|
-
lines.push(` Measured value: ${measuredValue.summary}`);
|
|
511
|
-
if (measuredValue.outcomeLine) {
|
|
512
|
-
lines.push(` Measured outcomes: ${measuredValue.outcomeLine}`);
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
else if (valueStatement) {
|
|
516
|
-
lines.push(` Value: ${valueStatement.summary}`);
|
|
517
|
-
if (valueStatement.costLine) {
|
|
518
|
-
lines.push(` Value $: ${valueStatement.costLine}`);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
else {
|
|
522
|
-
lines.push(' Value: estimated baseline only. Run `codeledger compare-current --guided` for measured with-vs-without data.');
|
|
523
|
-
}
|
|
524
|
-
// ── Split recall annotation ─────────────────────────────────────────
|
|
525
|
-
// When files were created during the session, show edit-recall separately
|
|
526
|
-
// since bundle recall for new files is inherently 0%.
|
|
527
|
-
// Lead with edit-recall when new files significantly impact raw recall.
|
|
528
|
-
if (s.created_file_count !== undefined && s.created_file_count > 0 && !isRepoScan) {
|
|
529
|
-
const editRecallPct = s.edit_recall !== undefined ? Math.round(s.edit_recall * 100) : recallPct;
|
|
530
|
-
const editedCount = s.files_changed.length - s.created_file_count;
|
|
531
|
-
const creationRatio = s.created_file_count / s.files_changed.length;
|
|
532
|
-
if (creationRatio >= 0.3) {
|
|
533
|
-
// New files significantly drag down raw recall — highlight edit-recall as primary metric
|
|
534
|
-
lines.push(` >> Edit-recall: ${editRecallPct}% (${editedCount} existing files) — this is the meaningful metric`);
|
|
535
|
-
lines.push(` ${s.created_file_count} new file${s.created_file_count === 1 ? ' was' : 's were'} created (bundles cannot predict files that don't exist yet)`);
|
|
536
|
-
}
|
|
537
|
-
else {
|
|
538
|
-
lines.push(` Edit-recall: ${editRecallPct}% (${editedCount} existing files) | ${s.created_file_count} new file${s.created_file_count === 1 ? '' : 's'} created (not predictable)`);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
// ── Debt injection section ───────────────────────────────────────────
|
|
542
|
-
if (s.debt && s.debt.total_suppressions > 0) {
|
|
543
|
-
lines.push(` Debt: ${s.debt.total_suppressions} suppression${s.debt.total_suppressions === 1 ? '' : 's'} detected (score: ${s.debt.debt_score.toFixed(2)})`);
|
|
544
|
-
// Show up to 3 debt warnings
|
|
545
|
-
for (const w of s.debt.warnings.slice(0, 3)) {
|
|
546
|
-
lines.push(` - ${w.file}:${w.line}: ${w.message}`);
|
|
547
|
-
}
|
|
548
|
-
if (s.debt.warnings.length > 3) {
|
|
549
|
-
lines.push(` ... and ${s.debt.warnings.length - 3} more`);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
// ── Commit hygiene section ──────────────────────────────────────────
|
|
553
|
-
if (s.commit_hygiene) {
|
|
554
|
-
const h = s.commit_hygiene;
|
|
555
|
-
const issues = [];
|
|
556
|
-
if (h.empty_commits > 0)
|
|
557
|
-
issues.push(`${h.empty_commits} empty`);
|
|
558
|
-
if (h.no_verify_count > 0)
|
|
559
|
-
issues.push(`${h.no_verify_count} --no-verify`);
|
|
560
|
-
if (h.out_of_scope_files.length > 0)
|
|
561
|
-
issues.push(`${h.out_of_scope_files.length} out-of-scope files`);
|
|
562
|
-
if (issues.length > 0) {
|
|
563
|
-
lines.push(` Commit hygiene: ${h.hygiene_score.toFixed(2)} (${issues.join(', ')})`);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
// ── Scope drift section ───────────────────────────────────────────
|
|
567
|
-
if (s.scope_drift_count !== undefined && s.scope_drift_count > 0) {
|
|
568
|
-
if (isRepoScan) {
|
|
569
|
-
lines.push(` Scope: repo-wide mechanical edits detected (${s.files_changed.length} files touched).`);
|
|
570
|
-
}
|
|
571
|
-
else {
|
|
572
|
-
lines.push(` Scope drift: ${s.scope_drift_count} file${s.scope_drift_count === 1 ? '' : 's'} edited outside scope contract`);
|
|
573
|
-
if (scopeDriftFiles && scopeDriftFiles.length > 0) {
|
|
574
|
-
for (const f of scopeDriftFiles.slice(0, 5)) {
|
|
575
|
-
lines.push(` - ${f}`);
|
|
576
|
-
}
|
|
577
|
-
if (scopeDriftFiles.length > 5) {
|
|
578
|
-
lines.push(` ... and ${scopeDriftFiles.length - 5} more`);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
// ── Regret metric (missed files) ────────────────────────────────
|
|
584
|
-
if (s.regret_files && s.regret_files.length > 0 && !isRepoScan && s.recall < 0.9) {
|
|
585
|
-
lines.push(` Missed files: ${s.regret_files.length} file${s.regret_files.length === 1 ? '' : 's'} changed but not in bundle`);
|
|
586
|
-
for (const f of s.regret_files.slice(0, 5)) {
|
|
587
|
-
lines.push(` - ${f}`);
|
|
588
|
-
}
|
|
589
|
-
if (s.regret_files.length > 5) {
|
|
590
|
-
lines.push(` ... and ${s.regret_files.length - 5} more`);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
// ── Conflict zone touches section ─────────────────────────────────
|
|
594
|
-
if (s.conflict_zone_touches !== undefined && s.conflict_zone_touches > 0) {
|
|
595
|
-
lines.push(` Conflict zones: ${s.conflict_zone_touches} contested file${s.conflict_zone_touches === 1 ? '' : 's'} were modified`);
|
|
596
|
-
}
|
|
597
|
-
// ── Bundle invalidation section ─────────────────────────────────
|
|
598
|
-
if (s.bundle_invalidation && s.bundle_invalidation.addressed_files.length > 0) {
|
|
599
|
-
const inv = s.bundle_invalidation;
|
|
600
|
-
const stalenessPct = Math.round(inv.staleness_ratio * 100);
|
|
601
|
-
lines.push(` Bundle freshness: ${inv.addressed_files.length} of ${inv.addressed_files.length + inv.fresh_files.length} files committed (${stalenessPct}% addressed)`);
|
|
602
|
-
if (inv.staleness_ratio >= 0.75) {
|
|
603
|
-
lines.push(` Tip: Bundle is mostly stale — refresh with "codeledger activate --task ${prefillTask ? `"${s.task}"` : '...'}" for updated context.`);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
// ── Checkpoint count section ────────────────────────────────────
|
|
607
|
-
if (s.checkpoint_count && s.checkpoint_count > 0) {
|
|
608
|
-
lines.push(` Checkpoints: ${s.checkpoint_count} saved`);
|
|
609
|
-
}
|
|
610
|
-
// ── Intent drift section ───────────────────────────────────────
|
|
611
|
-
if (intentDrift && intentDrift.drift.drift_level !== 'NONE') {
|
|
612
|
-
const d = intentDrift.drift;
|
|
613
|
-
lines.push(` Intent drift: ${d.drift_level} (${d.drift_score.toFixed(3)})`);
|
|
614
|
-
if (d.drift_level === 'MAJOR' || d.drift_level === 'CRITICAL') {
|
|
615
|
-
const topReasons = d.reasons.filter((r) => r.distance > 0).slice(0, 3);
|
|
616
|
-
for (const r of topReasons) {
|
|
617
|
-
lines.push(` - ${r.field}: ${r.distance.toFixed(3)}`);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
// ── Review coverage section (Sentinel) ─────────────────────────
|
|
622
|
-
if (s.review_coverage) {
|
|
623
|
-
const rc = s.review_coverage;
|
|
624
|
-
const pct = (rc.file_coverage * 100).toFixed(1);
|
|
625
|
-
const depthPct = (rc.depth_weighted_coverage * 100).toFixed(1);
|
|
626
|
-
const thresholdTag = rc.file_coverage >= 0.90 ? 'PASS' : 'BELOW 90%';
|
|
627
|
-
lines.push(` Review Coverage: ${rc.files_read.length}/${rc.required_files.length} files read (${pct}%) ${thresholdTag}`);
|
|
628
|
-
lines.push(` Depth Coverage: ${depthPct}%`);
|
|
629
|
-
if (rc.post_hoc_reads.length > 0) {
|
|
630
|
-
lines.push(` Post-hoc reads: ${rc.post_hoc_reads.length} file${rc.post_hoc_reads.length === 1 ? '' : 's'}`);
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
// ── Shadow files section ──────────────────────────────────────
|
|
634
|
-
if (shadowFiles && shadowFiles.length > 0) {
|
|
635
|
-
lines.push(` Shadow Files Included: ${shadowFiles.length}`);
|
|
636
|
-
for (const sf of shadowFiles) {
|
|
637
|
-
if (sf.shadow_reason) {
|
|
638
|
-
lines.push(` - ${sf.path} (affinity ${sf.shadow_reason.affinity.toFixed(2)} with ${sf.shadow_reason.linked_to})`);
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
lines.push(` [${s.bundle_id}]`);
|
|
643
|
-
lines.push('-'.repeat(61));
|
|
644
|
-
lines.push('');
|
|
645
|
-
lines.push(' \u26A1 Immediate value');
|
|
646
|
-
lines.push(` Files touched: ${s.files_changed.length}`);
|
|
647
|
-
if (s.context_reduction_pct > 0) {
|
|
648
|
-
lines.push(` Context reduction: ${Math.round(s.context_reduction_pct)}%`);
|
|
649
|
-
}
|
|
650
|
-
lines.push('');
|
|
651
|
-
lines.push(' \uD83D\uDC8E Compounding value');
|
|
652
|
-
lines.push(' Session evidence recorded');
|
|
653
|
-
if (s.regret_files && s.regret_files.length === 0) {
|
|
654
|
-
lines.push(' Bundle predicted all changes — pattern reinforced');
|
|
655
|
-
}
|
|
656
|
-
lines.push('');
|
|
657
|
-
lines.push(' Stored locally in .codeledger/');
|
|
658
|
-
lines.push('');
|
|
659
|
-
console.log(lines.join('\n'));
|
|
660
|
-
}
|
|
661
|
-
function classifySessionPattern(filesChanged) {
|
|
662
|
-
// Detect new files by checking git status for untracked/newly added
|
|
663
|
-
let newFileCount = 0;
|
|
664
|
-
try {
|
|
665
|
-
const untrackedRaw = execSync('git ls-files --others --exclude-standard', {
|
|
666
|
-
encoding: 'utf-8',
|
|
667
|
-
timeout: 5000,
|
|
668
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
669
|
-
}).trim();
|
|
670
|
-
const untracked = new Set(untrackedRaw ? untrackedRaw.split('\n') : []);
|
|
671
|
-
// Also check for files that were added in commits (new file mode)
|
|
672
|
-
const addedRaw = execSync('git diff --diff-filter=A --name-only HEAD~20..HEAD 2>/dev/null || echo ""', {
|
|
673
|
-
encoding: 'utf-8',
|
|
674
|
-
timeout: 5000,
|
|
675
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
676
|
-
}).trim();
|
|
677
|
-
const added = new Set(addedRaw ? addedRaw.split('\n') : []);
|
|
678
|
-
for (const f of filesChanged) {
|
|
679
|
-
if (untracked.has(f) || added.has(f)) {
|
|
680
|
-
newFileCount++;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
catch {
|
|
685
|
-
// Non-fatal — fall back to 0 new files
|
|
686
|
-
}
|
|
687
|
-
const newFileRatio = filesChanged.length > 0 ? newFileCount / filesChanged.length : 0;
|
|
688
|
-
// Detect infrastructure-heavy sessions by checking if changed files are
|
|
689
|
-
// predominantly config/migration/infra files rather than source code.
|
|
690
|
-
// Infrastructure file patterns — match directory names and filenames, not
|
|
691
|
-
// substrings, to avoid false positives (e.g. "src/docker-utils.ts" is NOT infra).
|
|
692
|
-
const infraPatterns = [
|
|
693
|
-
/migrations?\//i, /\.sql$/i, /\.env(\.|$)/i,
|
|
694
|
-
/(?:^|\/)dockerfile/i, /(?:^|\/)docker-compose/i,
|
|
695
|
-
/(?:^|\/)makefile$/i, /\.sh$/i,
|
|
696
|
-
/(?:^|\/)k8s\//i, /(?:^|\/)kubernetes\//i, /(?:^|\/)helm\//i,
|
|
697
|
-
/(?:^|\/)terraform\//i, /\.tf$/i, /\.tfvars$/i,
|
|
698
|
-
/(?:^|\/)deploy\//i, /(?:^|\/)infra\//i, /(?:^|\/)infrastructure\//i,
|
|
699
|
-
/(?:^|\/)scripts?\//i, /\.github\//i, /ci\.ya?ml$/i,
|
|
700
|
-
];
|
|
701
|
-
const infraFileCount = filesChanged.filter((f) => infraPatterns.some((pat) => pat.test(f))).length;
|
|
702
|
-
const infraRatio = filesChanged.length > 0 ? infraFileCount / filesChanged.length : 0;
|
|
703
|
-
const isInfrastructure = infraRatio > 0.5 || (filesChanged.length <= 3 && infraFileCount > 0);
|
|
704
|
-
return {
|
|
705
|
-
newFileCount,
|
|
706
|
-
newFileRatio,
|
|
707
|
-
isExploratory: newFileRatio > 0.5,
|
|
708
|
-
isBroad: filesChanged.length > 50,
|
|
709
|
-
isInfrastructure,
|
|
710
|
-
infraFileCount,
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
/**
|
|
714
|
-
* Classify changed files into edits (pre-existing files modified) vs creations
|
|
715
|
-
* (new files added during the session). This allows split recall reporting:
|
|
716
|
-
* edit-recall measures bundle accuracy for predictable changes, while
|
|
717
|
-
* creation-recall is always 0 (bundles can't predict files that don't exist).
|
|
718
|
-
*/
|
|
719
|
-
function classifyEditedVsCreated(cwd, filesChanged, sessionId) {
|
|
720
|
-
const createdPaths = new Set();
|
|
721
|
-
try {
|
|
722
|
-
// Untracked files = definitely created this session
|
|
723
|
-
const untrackedRaw = execSync('git ls-files --others --exclude-standard', {
|
|
724
|
-
cwd,
|
|
725
|
-
encoding: 'utf-8',
|
|
726
|
-
timeout: 5000,
|
|
727
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
728
|
-
}).trim();
|
|
729
|
-
if (untrackedRaw) {
|
|
730
|
-
for (const f of untrackedRaw.split('\n'))
|
|
731
|
-
createdPaths.add(f);
|
|
732
|
-
}
|
|
733
|
-
// Files added in commits since session start
|
|
734
|
-
const activateRefPath = sessionActivateRef(cwd, sessionId);
|
|
735
|
-
const sessionRefPath = sessionStartRef(cwd, sessionId);
|
|
736
|
-
const refPath = existsSync(activateRefPath) ? activateRefPath : sessionRefPath;
|
|
737
|
-
if (existsSync(refPath)) {
|
|
738
|
-
const startRef = readFileSync(refPath, 'utf-8').trim();
|
|
739
|
-
if (startRef) {
|
|
740
|
-
try {
|
|
741
|
-
const addedRaw = execSync(`git diff --diff-filter=A --name-only ${startRef}..HEAD`, { cwd, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
742
|
-
if (addedRaw) {
|
|
743
|
-
for (const f of addedRaw.split('\n'))
|
|
744
|
-
createdPaths.add(f);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
catch {
|
|
748
|
-
// Non-fatal: ref may not be valid
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
catch {
|
|
754
|
-
// Non-fatal: fall back to treating all files as edits
|
|
755
|
-
}
|
|
756
|
-
const editedFiles = filesChanged.filter((f) => !createdPaths.has(f));
|
|
757
|
-
const createdFiles = filesChanged.filter((f) => createdPaths.has(f));
|
|
758
|
-
return { editedFiles, createdFiles };
|
|
759
|
-
}
|
|
760
|
-
function fmtTokens(n) {
|
|
761
|
-
if (n >= 1000)
|
|
762
|
-
return `${(n / 1000).toFixed(1)}k`;
|
|
763
|
-
return `${n}`;
|
|
764
|
-
}
|
|
765
|
-
function fmtSigned(n) {
|
|
766
|
-
const sign = n >= 0 ? '+' : '';
|
|
767
|
-
return `${sign}${n}`;
|
|
768
|
-
}
|
|
769
|
-
function formatValueStatement(bundleTokens, repoTokens, activationCount) {
|
|
770
|
-
if (bundleTokens <= 0 || repoTokens <= 0 || activationCount <= 0)
|
|
771
|
-
return null;
|
|
772
|
-
const baselineTokens = repoTokens * activationCount;
|
|
773
|
-
const savedTokens = baselineTokens - bundleTokens;
|
|
774
|
-
if (savedTokens <= 0)
|
|
775
|
-
return null;
|
|
776
|
-
const reductionPct = Math.round((savedTokens / baselineTokens) * 100);
|
|
777
|
-
const activationLabel = activationCount === 1
|
|
778
|
-
? '1 task activation'
|
|
779
|
-
: `${activationCount} task activations`;
|
|
780
|
-
const summary = `avoided ~${fmtTokens(savedTokens)} input tokens vs a no-CodeLedger full-repo baseline (~${fmtTokens(baselineTokens)} tokens across ${activationLabel}, ${reductionPct}% less context)`;
|
|
781
|
-
const estCostSaved = (savedTokens / 1_000_000) * 3;
|
|
782
|
-
const costLine = estCostSaved >= 0.01
|
|
783
|
-
? `~$${estCostSaved.toFixed(2)} estimated input cost avoided at $3/M tokens`
|
|
784
|
-
: undefined;
|
|
785
|
-
return { summary, costLine };
|
|
786
|
-
}
|
|
787
|
-
function loadMeasuredBenchmarkValue(cwd, task) {
|
|
788
|
-
const reportsRoot = join(cwd, '.codeledger', 'reports');
|
|
789
|
-
if (!existsSync(reportsRoot))
|
|
790
|
-
return null;
|
|
791
|
-
const target = intentNorm(task);
|
|
792
|
-
if (!target)
|
|
793
|
-
return null;
|
|
794
|
-
const reportPaths = readdirSync(reportsRoot)
|
|
795
|
-
.map((entry) => join(reportsRoot, entry, 'report.json'))
|
|
796
|
-
.filter((path) => existsSync(path))
|
|
797
|
-
.map((path) => ({
|
|
798
|
-
path,
|
|
799
|
-
mtime: statSync(path).mtimeMs,
|
|
800
|
-
}))
|
|
801
|
-
.sort((a, b) => b.mtime - a.mtime);
|
|
802
|
-
for (const candidate of reportPaths) {
|
|
803
|
-
try {
|
|
804
|
-
const report = JSON.parse(readFileSync(candidate.path, 'utf-8'));
|
|
805
|
-
if (!report.task_prompt)
|
|
806
|
-
continue;
|
|
807
|
-
if (intentNorm(report.task_prompt) !== target)
|
|
808
|
-
continue;
|
|
809
|
-
return formatMeasuredBenchmarkValue(report);
|
|
810
|
-
}
|
|
811
|
-
catch {
|
|
812
|
-
// Ignore malformed report artifacts.
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
return null;
|
|
816
|
-
}
|
|
817
|
-
function formatMeasuredBenchmarkValue(report) {
|
|
818
|
-
const delta = report.aggregate.delta;
|
|
819
|
-
if (!Number.isFinite(delta.token_estimate_pct) && !Number.isFinite(delta.duration_sec_pct)) {
|
|
820
|
-
return null;
|
|
821
|
-
}
|
|
822
|
-
const summaryParts = [];
|
|
823
|
-
if (Number.isFinite(delta.token_estimate_pct)) {
|
|
824
|
-
if (delta.token_estimate_pct < 0) {
|
|
825
|
-
summaryParts.push(`${Math.abs(delta.token_estimate_pct)}% lower token usage vs measured without-CodeLedger runs`);
|
|
826
|
-
}
|
|
827
|
-
else if (delta.token_estimate_pct > 0) {
|
|
828
|
-
summaryParts.push(`${delta.token_estimate_pct}% higher token usage vs measured without-CodeLedger runs`);
|
|
829
|
-
}
|
|
830
|
-
else {
|
|
831
|
-
summaryParts.push('no token-usage change vs measured without-CodeLedger runs');
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
if (Number.isFinite(delta.duration_sec_pct)) {
|
|
835
|
-
if (delta.duration_sec_pct < 0) {
|
|
836
|
-
summaryParts.push(`${Math.abs(delta.duration_sec_pct)}% faster completion`);
|
|
837
|
-
}
|
|
838
|
-
else if (delta.duration_sec_pct > 0) {
|
|
839
|
-
summaryParts.push(`${delta.duration_sec_pct}% slower completion`);
|
|
840
|
-
}
|
|
841
|
-
else {
|
|
842
|
-
summaryParts.push('no duration change');
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
let outcomeLine;
|
|
846
|
-
const outcomes = report.aggregate.outcomes;
|
|
847
|
-
if (outcomes) {
|
|
848
|
-
outcomeLine = `acceptance ${outcomes.acceptance_rate_without}% -> ${outcomes.acceptance_rate_with}% (${fmtSigned(outcomes.acceptance_rate_uplift_pct)}pp)`;
|
|
849
|
-
if (outcomes.time_to_acceptance_reduction_pct !== null) {
|
|
850
|
-
outcomeLine += `, time-to-acceptance ${fmtSigned(outcomes.time_to_acceptance_reduction_pct)}%`;
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
if (summaryParts.length === 0)
|
|
854
|
-
return null;
|
|
855
|
-
return {
|
|
856
|
-
summary: summaryParts.join(', '),
|
|
857
|
-
outcomeLine,
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
// ── Debt Injection Detection ────────────────────────────────────────────────
|
|
861
|
-
function analyzeDebt(cwd, sessionId) {
|
|
862
|
-
const activateRefPath = sessionActivateRef(cwd, sessionId);
|
|
863
|
-
const sessionRefPath = sessionStartRef(cwd, sessionId);
|
|
864
|
-
const refPath = existsSync(activateRefPath) ? activateRefPath : sessionRefPath;
|
|
865
|
-
if (!existsSync(refPath))
|
|
866
|
-
return null;
|
|
867
|
-
const startRef = readFileSync(refPath, 'utf-8').trim();
|
|
868
|
-
if (!startRef)
|
|
869
|
-
return null;
|
|
870
|
-
try {
|
|
871
|
-
const diff = execSync(`git diff ${startRef}..HEAD`, {
|
|
872
|
-
cwd,
|
|
873
|
-
encoding: 'utf-8',
|
|
874
|
-
timeout: 10000,
|
|
875
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
876
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
877
|
-
});
|
|
878
|
-
if (!diff.trim())
|
|
879
|
-
return null;
|
|
880
|
-
// Dynamic import to avoid bundling selector into CLI at compile time
|
|
881
|
-
const debtFns = loadDebtDetection();
|
|
882
|
-
if (!debtFns.scanDebtPatterns || !debtFns.computeDebtScore)
|
|
883
|
-
return null;
|
|
884
|
-
const warnings = debtFns.scanDebtPatterns(diff);
|
|
885
|
-
const addedLines = diff.split('\n').filter((l) => l.startsWith('+') && !l.startsWith('+++')).length;
|
|
886
|
-
const debtScore = debtFns.computeDebtScore(warnings, addedLines);
|
|
887
|
-
return {
|
|
888
|
-
warnings,
|
|
889
|
-
total_suppressions: warnings.length,
|
|
890
|
-
debt_score: debtScore,
|
|
891
|
-
};
|
|
892
|
-
}
|
|
893
|
-
catch {
|
|
894
|
-
return null;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
function loadDebtDetection() {
|
|
898
|
-
try {
|
|
899
|
-
// Inline implementation to avoid cross-package import complexity
|
|
900
|
-
const DEBT_PATTERNS = [
|
|
901
|
-
{ pattern: /@Suppress\b/, message: '@Suppress annotation suppresses warnings' },
|
|
902
|
-
{ pattern: /@SuppressWarnings\b/, message: '@SuppressWarnings hides compiler warnings' },
|
|
903
|
-
{ pattern: /eslint-disable(?!-next-line)/, message: 'eslint-disable disables linting for entire block' },
|
|
904
|
-
{ pattern: /eslint-disable-next-line/, message: 'eslint-disable-next-line suppresses linting' },
|
|
905
|
-
{ pattern: /@ts-ignore\b/, message: '@ts-ignore suppresses TypeScript errors' },
|
|
906
|
-
{ pattern: /@ts-expect-error\b/, message: '@ts-expect-error suppresses a TypeScript error' },
|
|
907
|
-
{ pattern: /:\s*any\b/, message: 'Explicit `any` type bypasses type safety' },
|
|
908
|
-
{ pattern: /as\s+any\b/, message: '`as any` assertion bypasses type safety' },
|
|
909
|
-
{ pattern: /\/\/\s*noinspection\b/, message: 'noinspection comment suppresses IDE warnings' },
|
|
910
|
-
{ pattern: /NOSONAR\b/, message: 'NOSONAR suppresses static analysis' },
|
|
911
|
-
{ pattern: /--no-verify\b/, message: '--no-verify skips pre-commit hooks' },
|
|
912
|
-
];
|
|
913
|
-
const scanDebtPatterns = (diffContent) => {
|
|
914
|
-
const warnings = [];
|
|
915
|
-
const lines = diffContent.split('\n');
|
|
916
|
-
let currentFile = '';
|
|
917
|
-
let lineNumber = 0;
|
|
918
|
-
for (const line of lines) {
|
|
919
|
-
const fileMatch = /^\+\+\+ b\/(.+)$/.exec(line);
|
|
920
|
-
if (fileMatch) {
|
|
921
|
-
currentFile = fileMatch[1];
|
|
922
|
-
if (currentFile.startsWith('.codeledger/') || currentFile.startsWith('.claude/')) {
|
|
923
|
-
currentFile = '';
|
|
924
|
-
}
|
|
925
|
-
lineNumber = 0;
|
|
926
|
-
continue;
|
|
927
|
-
}
|
|
928
|
-
const hunkMatch = /^@@ -\d+(?:,\d+)? \+(\d+)/.exec(line);
|
|
929
|
-
if (hunkMatch) {
|
|
930
|
-
lineNumber = parseInt(hunkMatch[1], 10);
|
|
931
|
-
continue;
|
|
932
|
-
}
|
|
933
|
-
if (!currentFile) {
|
|
934
|
-
continue;
|
|
935
|
-
}
|
|
936
|
-
if (line.startsWith('+') && !line.startsWith('+++')) {
|
|
937
|
-
const content = line.slice(1);
|
|
938
|
-
for (const { pattern, message } of DEBT_PATTERNS) {
|
|
939
|
-
if (pattern.test(content)) {
|
|
940
|
-
warnings.push({ file: currentFile, line: lineNumber, pattern: pattern.source, message });
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
lineNumber++;
|
|
944
|
-
}
|
|
945
|
-
else if (!line.startsWith('-')) {
|
|
946
|
-
lineNumber++;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
return warnings;
|
|
950
|
-
};
|
|
951
|
-
const computeDebtScore = (warnings, lineCount) => {
|
|
952
|
-
if (lineCount === 0 || warnings.length === 0)
|
|
953
|
-
return 0;
|
|
954
|
-
const ratio = warnings.length / (lineCount / 10);
|
|
955
|
-
return Math.min(1.0, Math.round(ratio * 100) / 100);
|
|
956
|
-
};
|
|
957
|
-
return { scanDebtPatterns, computeDebtScore };
|
|
958
|
-
}
|
|
959
|
-
catch {
|
|
960
|
-
return { scanDebtPatterns: null, computeDebtScore: null };
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
// ── Commit Hygiene Analysis ─────────────────────────────────────────────────
|
|
964
|
-
function analyzeCommitHygiene(cwd, sessionId, bundleFiles) {
|
|
965
|
-
const activateRefPath = sessionActivateRef(cwd, sessionId);
|
|
966
|
-
const sessionRefPath = sessionStartRef(cwd, sessionId);
|
|
967
|
-
const refPath = existsSync(activateRefPath) ? activateRefPath : sessionRefPath;
|
|
968
|
-
if (!existsSync(refPath))
|
|
969
|
-
return null;
|
|
970
|
-
const startRef = readFileSync(refPath, 'utf-8').trim();
|
|
971
|
-
if (!startRef)
|
|
972
|
-
return null;
|
|
973
|
-
try {
|
|
974
|
-
// Get commit log since start ref
|
|
975
|
-
const log = execSync(`git log --format="%H %s" ${startRef}..HEAD`, { cwd, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
976
|
-
if (!log)
|
|
977
|
-
return null;
|
|
978
|
-
const commits = log.split('\n').filter(Boolean);
|
|
979
|
-
let emptyCommits = 0;
|
|
980
|
-
let noVerifyCount = 0;
|
|
981
|
-
let forcePushCount = 0;
|
|
982
|
-
for (const commit of commits) {
|
|
983
|
-
const sha = commit.split(' ')[0];
|
|
984
|
-
// Check for empty commits (no file changes)
|
|
985
|
-
try {
|
|
986
|
-
const files = execSync(`git diff-tree --no-commit-id --name-only -r ${sha}`, {
|
|
987
|
-
cwd, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'],
|
|
988
|
-
}).trim();
|
|
989
|
-
if (!files)
|
|
990
|
-
emptyCommits++;
|
|
991
|
-
}
|
|
992
|
-
catch {
|
|
993
|
-
// non-fatal
|
|
994
|
-
}
|
|
995
|
-
// Check commit message for --no-verify indicators
|
|
996
|
-
const message = commit.slice(sha.length + 1);
|
|
997
|
-
if (message.includes('--no-verify') || message.includes('[skip ci]')) {
|
|
998
|
-
noVerifyCount++;
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
// Detect out-of-scope files (changed files not in bundle)
|
|
1002
|
-
const bundleSet = new Set(bundleFiles);
|
|
1003
|
-
const changedFiles = new Set();
|
|
1004
|
-
try {
|
|
1005
|
-
const diff = execSync(`git diff --name-only ${startRef}..HEAD`, {
|
|
1006
|
-
cwd, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'],
|
|
1007
|
-
}).trim();
|
|
1008
|
-
if (diff) {
|
|
1009
|
-
for (const f of diff.split('\n')) {
|
|
1010
|
-
if (!f.startsWith('.codeledger/') && !f.startsWith('.claude/'))
|
|
1011
|
-
changedFiles.add(f);
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
catch {
|
|
1016
|
-
// non-fatal
|
|
1017
|
-
}
|
|
1018
|
-
const outOfScope = [...changedFiles].filter((f) => !bundleSet.has(f));
|
|
1019
|
-
// Compute hygiene score: 1.0 = perfect, deductions for issues
|
|
1020
|
-
let hygieneScore = 1.0;
|
|
1021
|
-
if (commits.length > 0) {
|
|
1022
|
-
hygieneScore -= (emptyCommits / commits.length) * 0.3;
|
|
1023
|
-
hygieneScore -= (noVerifyCount / commits.length) * 0.3;
|
|
1024
|
-
}
|
|
1025
|
-
if (changedFiles.size > 0 && outOfScope.length > 0) {
|
|
1026
|
-
hygieneScore -= Math.min(0.3, (outOfScope.length / changedFiles.size) * 0.3);
|
|
1027
|
-
}
|
|
1028
|
-
hygieneScore = Math.max(0, Math.round(hygieneScore * 100) / 100);
|
|
1029
|
-
return {
|
|
1030
|
-
total_commits: commits.length,
|
|
1031
|
-
empty_commits: emptyCommits,
|
|
1032
|
-
no_verify_count: noVerifyCount,
|
|
1033
|
-
force_push_count: forcePushCount,
|
|
1034
|
-
out_of_scope_files: outOfScope,
|
|
1035
|
-
hygiene_score: hygieneScore,
|
|
1036
|
-
};
|
|
1037
|
-
}
|
|
1038
|
-
catch {
|
|
1039
|
-
return null;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
/**
|
|
1043
|
-
* When the session involved multiple tasks, print a per-task breakdown
|
|
1044
|
-
* showing recall/precision for each activate call, plus session-wide totals.
|
|
1045
|
-
*
|
|
1046
|
-
* Reads `.task-history.jsonl` to reconstruct what happened in each task.
|
|
1047
|
-
*/
|
|
1048
|
-
function printSessionAggregate(cwd, sessionId, lastTaskSummary) {
|
|
1049
|
-
const sessionRefPath = sessionStartRef(cwd, sessionId);
|
|
1050
|
-
if (!existsSync(sessionRefPath))
|
|
1051
|
-
return;
|
|
1052
|
-
const sessionRef = readFileSync(sessionRefPath, 'utf-8').trim();
|
|
1053
|
-
if (!sessionRef)
|
|
1054
|
-
return;
|
|
1055
|
-
// -- Load task history (JSONL) -------------------------------------------
|
|
1056
|
-
const historyPath = sessionTaskHistoryPath(cwd, sessionId);
|
|
1057
|
-
const activations = loadTaskHistory(historyPath);
|
|
1058
|
-
// -- Count commits since session start -----------------------------------
|
|
1059
|
-
let commitCount = 0;
|
|
1060
|
-
try {
|
|
1061
|
-
const count = execSync(`git rev-list --count ${sessionRef}..HEAD`, {
|
|
1062
|
-
cwd,
|
|
1063
|
-
encoding: 'utf-8',
|
|
1064
|
-
timeout: 5000,
|
|
1065
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1066
|
-
}).trim();
|
|
1067
|
-
commitCount = parseInt(count, 10) || 0;
|
|
1068
|
-
}
|
|
1069
|
-
catch {
|
|
1070
|
-
// non-fatal
|
|
1071
|
-
}
|
|
1072
|
-
// -- Gather all files changed across the entire session -------------------
|
|
1073
|
-
const allChanged = new Set();
|
|
1074
|
-
try {
|
|
1075
|
-
const committed = execSync(`git diff --name-only ${sessionRef}..HEAD`, {
|
|
1076
|
-
cwd,
|
|
1077
|
-
encoding: 'utf-8',
|
|
1078
|
-
timeout: 5000,
|
|
1079
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1080
|
-
}).trim();
|
|
1081
|
-
if (committed) {
|
|
1082
|
-
for (const f of committed.split('\n')) {
|
|
1083
|
-
if (!f.startsWith('.codeledger/') && !f.startsWith('.claude/'))
|
|
1084
|
-
allChanged.add(f);
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
catch {
|
|
1089
|
-
// non-fatal
|
|
1090
|
-
}
|
|
1091
|
-
try {
|
|
1092
|
-
const uncommitted = execSync('git diff --name-only HEAD', {
|
|
1093
|
-
cwd,
|
|
1094
|
-
encoding: 'utf-8',
|
|
1095
|
-
timeout: 5000,
|
|
1096
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1097
|
-
}).trim();
|
|
1098
|
-
if (uncommitted) {
|
|
1099
|
-
for (const f of uncommitted.split('\n')) {
|
|
1100
|
-
if (!f.startsWith('.codeledger/') && !f.startsWith('.claude/'))
|
|
1101
|
-
allChanged.add(f);
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
catch {
|
|
1106
|
-
// non-fatal
|
|
1107
|
-
}
|
|
1108
|
-
// -- Compute per-task metrics -------------------------------------------
|
|
1109
|
-
const taskMetrics = computePerTaskMetrics(cwd, activations);
|
|
1110
|
-
const lines = [];
|
|
1111
|
-
lines.push('');
|
|
1112
|
-
lines.push('-- Session Summary (all tasks) --------------------------------');
|
|
1113
|
-
if (sessionId) {
|
|
1114
|
-
lines.push(` Session: ${sessionId}`);
|
|
1115
|
-
}
|
|
1116
|
-
// Per-task breakdown (only if there's history and at least one task had changes)
|
|
1117
|
-
if (taskMetrics.length > 0) {
|
|
1118
|
-
lines.push('');
|
|
1119
|
-
for (let i = 0; i < taskMetrics.length; i++) {
|
|
1120
|
-
const m = taskMetrics[i];
|
|
1121
|
-
const recallPct = Math.round(m.recall * 100);
|
|
1122
|
-
const precisionPct = Math.round(m.precision * 100);
|
|
1123
|
-
const icon = m.verdict === 'HIT' ? '\u2705' : m.verdict === 'PARTIAL' ? '\u{1F7E1}' : '\u274C';
|
|
1124
|
-
lines.push(` Task ${i + 1}: "${truncate(m.task, 55)}"`);
|
|
1125
|
-
if (m.files_changed.length === 0) {
|
|
1126
|
-
lines.push(` No files changed — skipped`);
|
|
1127
|
-
}
|
|
1128
|
-
else {
|
|
1129
|
-
lines.push(` Recall: ${m.files_overlapping.length}/${m.files_changed.length} (${recallPct}%) Precision: ${m.files_overlapping.length}/${m.bundle_file_count} (${precisionPct}%) ${icon} ${m.verdict}`);
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
else if (allChanged.size > lastTaskSummary.files_changed.length) {
|
|
1134
|
-
// Fallback: no task history but session had multiple tasks worth of changes
|
|
1135
|
-
lines.push(` ${allChanged.size} files changed across ${commitCount} commit${commitCount === 1 ? '' : 's'}`);
|
|
1136
|
-
}
|
|
1137
|
-
// Session totals
|
|
1138
|
-
if (taskMetrics.length > 1 || (taskMetrics.length === 0 && allChanged.size > 0)) {
|
|
1139
|
-
const totalChanged = taskMetrics.length > 0
|
|
1140
|
-
? new Set(taskMetrics.flatMap((m) => m.files_changed)).size
|
|
1141
|
-
: allChanged.size;
|
|
1142
|
-
const totalOverlap = taskMetrics.length > 0
|
|
1143
|
-
? new Set(taskMetrics.flatMap((m) => m.files_overlapping)).size
|
|
1144
|
-
: lastTaskSummary.files_overlapping.length;
|
|
1145
|
-
const sessionRecall = totalChanged > 0 ? totalOverlap / totalChanged : 0;
|
|
1146
|
-
const sessionRecallPct = Math.round(sessionRecall * 100);
|
|
1147
|
-
const hits = taskMetrics.filter((m) => m.verdict === 'HIT').length;
|
|
1148
|
-
const partials = taskMetrics.filter((m) => m.verdict === 'PARTIAL').length;
|
|
1149
|
-
const misses = taskMetrics.filter((m) => m.verdict === 'MISS').length;
|
|
1150
|
-
lines.push('');
|
|
1151
|
-
lines.push(` Session: ${totalChanged} files changed, ${commitCount} commit${commitCount === 1 ? '' : 's'}, ${sessionRecallPct}% overall recall`);
|
|
1152
|
-
if (taskMetrics.length > 0) {
|
|
1153
|
-
lines.push(` Tasks: ${hits} hit, ${partials} partial, ${misses} miss (${taskMetrics.length} total)`);
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
const activationCount = Math.max(activations.length, 1);
|
|
1157
|
-
const totalBundleTokens = activations.length > 0
|
|
1158
|
-
? activations.reduce((sum, activation) => sum + activation.bundle_tokens, 0)
|
|
1159
|
-
: lastTaskSummary.bundle_tokens;
|
|
1160
|
-
const sessionValue = formatValueStatement(totalBundleTokens, lastTaskSummary.repo_total_tokens, activationCount);
|
|
1161
|
-
const sessionMeasuredValue = loadMeasuredBenchmarkValue(cwd, lastTaskSummary.task);
|
|
1162
|
-
if (sessionMeasuredValue) {
|
|
1163
|
-
lines.push('');
|
|
1164
|
-
lines.push(` Measured value: ${sessionMeasuredValue.summary}`);
|
|
1165
|
-
if (sessionMeasuredValue.outcomeLine) {
|
|
1166
|
-
lines.push(` Measured outcomes: ${sessionMeasuredValue.outcomeLine}`);
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
else if (sessionValue) {
|
|
1170
|
-
lines.push('');
|
|
1171
|
-
lines.push(` Value: ${sessionValue.summary}`);
|
|
1172
|
-
if (sessionValue.costLine) {
|
|
1173
|
-
lines.push(` Value $: ${sessionValue.costLine}`);
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
else {
|
|
1177
|
-
lines.push('');
|
|
1178
|
-
lines.push(' Value: estimated baseline only. Run `codeledger compare-current --guided` for measured with-vs-without data.');
|
|
1179
|
-
}
|
|
1180
|
-
lines.push('-'.repeat(61));
|
|
1181
|
-
lines.push('');
|
|
1182
|
-
console.log(lines.join('\n'));
|
|
1183
|
-
}
|
|
1184
|
-
// ── Scope Drift Detection ───────────────────────────────────────────────────
|
|
1185
|
-
function getScopeDriftFiles(changedFiles, scopeContract) {
|
|
1186
|
-
const scopeSet = new Set([...scopeContract.bundle_files, ...scopeContract.neighbor_files]);
|
|
1187
|
-
return changedFiles.filter((f) => !scopeSet.has(f));
|
|
1188
|
-
}
|
|
1189
|
-
// ── Conflict Zone Touches ───────────────────────────────────────────────────
|
|
1190
|
-
function countConflictTouches(changedFiles, conflictZones) {
|
|
1191
|
-
const conflictFiles = new Set(conflictZones.map((z) => z.file));
|
|
1192
|
-
return changedFiles.filter((f) => conflictFiles.has(f)).length;
|
|
1193
|
-
}
|
|
1194
|
-
// ── Bundle Invalidation (Commit-Aware) ──────────────────────────────────────
|
|
1195
|
-
function analyzeBundleInvalidation(cwd, sessionId, bundleFiles) {
|
|
1196
|
-
if (bundleFiles.length === 0)
|
|
1197
|
-
return null;
|
|
1198
|
-
// Get the activate ref to know when the bundle was generated
|
|
1199
|
-
const activateRefPath = sessionActivateRef(cwd, sessionId);
|
|
1200
|
-
const sessionRefPath = sessionStartRef(cwd, sessionId);
|
|
1201
|
-
const refPath = existsSync(activateRefPath) ? activateRefPath : sessionRefPath;
|
|
1202
|
-
if (!existsSync(refPath))
|
|
1203
|
-
return null;
|
|
1204
|
-
const startRef = readFileSync(refPath, 'utf-8').trim();
|
|
1205
|
-
if (!startRef)
|
|
1206
|
-
return null;
|
|
1207
|
-
try {
|
|
1208
|
-
// Get commit log with file names since the bundle was generated
|
|
1209
|
-
const log = execSync(`git log --format="%H %aI" --name-only ${startRef}..HEAD`, { cwd, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
1210
|
-
if (!log)
|
|
1211
|
-
return null;
|
|
1212
|
-
// Parse which files were committed
|
|
1213
|
-
const committedFiles = new Map();
|
|
1214
|
-
const lines = log.split('\n');
|
|
1215
|
-
let currentSha = '';
|
|
1216
|
-
let currentDate = '';
|
|
1217
|
-
for (const line of lines) {
|
|
1218
|
-
const trimmed = line.trim();
|
|
1219
|
-
if (!trimmed)
|
|
1220
|
-
continue;
|
|
1221
|
-
const commitMatch = /^([0-9a-f]{40})\s+(.+)$/.exec(trimmed);
|
|
1222
|
-
if (commitMatch) {
|
|
1223
|
-
currentSha = commitMatch[1];
|
|
1224
|
-
currentDate = commitMatch[2];
|
|
1225
|
-
continue;
|
|
1226
|
-
}
|
|
1227
|
-
// File path — only record the first (most recent) commit
|
|
1228
|
-
if (currentSha && !committedFiles.has(trimmed)) {
|
|
1229
|
-
committedFiles.set(trimmed, { commit_sha: currentSha, committed_at: currentDate });
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
if (committedFiles.size === 0)
|
|
1233
|
-
return null;
|
|
1234
|
-
// Cross-reference with bundle files
|
|
1235
|
-
const addressed = [];
|
|
1236
|
-
const fresh = [];
|
|
1237
|
-
for (const filePath of bundleFiles) {
|
|
1238
|
-
const commitInfo = committedFiles.get(filePath);
|
|
1239
|
-
if (commitInfo) {
|
|
1240
|
-
addressed.push({
|
|
1241
|
-
path: filePath,
|
|
1242
|
-
addressed_at: commitInfo.committed_at,
|
|
1243
|
-
commit_sha: commitInfo.commit_sha,
|
|
1244
|
-
});
|
|
1245
|
-
}
|
|
1246
|
-
else {
|
|
1247
|
-
fresh.push(filePath);
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
if (addressed.length === 0)
|
|
1251
|
-
return null;
|
|
1252
|
-
return {
|
|
1253
|
-
addressed_files: addressed,
|
|
1254
|
-
fresh_files: fresh,
|
|
1255
|
-
staleness_ratio: Math.round((addressed.length / bundleFiles.length) * 100) / 100,
|
|
1256
|
-
};
|
|
1257
|
-
}
|
|
1258
|
-
catch {
|
|
1259
|
-
return null;
|
|
1260
|
-
}
|
|
1261
|
-
}
|
|
1262
|
-
// ── Per-Task History & Metrics ──────────────────────────────────────────────
|
|
1263
|
-
/**
|
|
1264
|
-
* Load the JSONL task history file. Returns an empty array if missing or
|
|
1265
|
-
* malformed (best-effort — task history is non-critical).
|
|
1266
|
-
*/
|
|
1267
|
-
function loadTaskHistory(historyPath) {
|
|
1268
|
-
if (!existsSync(historyPath))
|
|
1269
|
-
return [];
|
|
1270
|
-
try {
|
|
1271
|
-
const content = readFileSync(historyPath, 'utf-8').trim();
|
|
1272
|
-
if (!content)
|
|
1273
|
-
return [];
|
|
1274
|
-
return content
|
|
1275
|
-
.split('\n')
|
|
1276
|
-
.filter(Boolean)
|
|
1277
|
-
.map((line) => {
|
|
1278
|
-
try {
|
|
1279
|
-
return JSON.parse(line);
|
|
1280
|
-
}
|
|
1281
|
-
catch {
|
|
1282
|
-
return null;
|
|
1283
|
-
}
|
|
1284
|
-
})
|
|
1285
|
-
.filter((r) => r !== null);
|
|
1286
|
-
}
|
|
1287
|
-
catch {
|
|
1288
|
-
return [];
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
/**
|
|
1292
|
-
* For each activation in the task history, compute the files changed between
|
|
1293
|
-
* that activation's ref and the next activation's ref (or HEAD for the last one).
|
|
1294
|
-
* Then compute recall/precision against that task's bundle.
|
|
1295
|
-
*/
|
|
1296
|
-
function computePerTaskMetrics(cwd, activations) {
|
|
1297
|
-
if (activations.length === 0)
|
|
1298
|
-
return [];
|
|
1299
|
-
const metrics = [];
|
|
1300
|
-
for (let i = 0; i < activations.length; i++) {
|
|
1301
|
-
const activation = activations[i];
|
|
1302
|
-
const nextActivation = activations[i + 1];
|
|
1303
|
-
// Determine the end ref: next activation's ref or HEAD
|
|
1304
|
-
const startRef = activation.activate_ref;
|
|
1305
|
-
let endRef = 'HEAD';
|
|
1306
|
-
if (nextActivation) {
|
|
1307
|
-
endRef = nextActivation.activate_ref;
|
|
1308
|
-
}
|
|
1309
|
-
// Get files changed in this task's window
|
|
1310
|
-
const filesChanged = getFilesChangedBetween(cwd, startRef, endRef);
|
|
1311
|
-
// Also include uncommitted changes if this is the last task
|
|
1312
|
-
if (!nextActivation) {
|
|
1313
|
-
try {
|
|
1314
|
-
const uncommitted = execSync('git diff --name-only HEAD', {
|
|
1315
|
-
cwd,
|
|
1316
|
-
encoding: 'utf-8',
|
|
1317
|
-
timeout: 5000,
|
|
1318
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1319
|
-
}).trim();
|
|
1320
|
-
if (uncommitted) {
|
|
1321
|
-
for (const f of uncommitted.split('\n')) {
|
|
1322
|
-
if (!f.startsWith('.codeledger/') && !f.startsWith('.claude/'))
|
|
1323
|
-
filesChanged.add(f);
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
catch {
|
|
1328
|
-
// non-fatal
|
|
1329
|
-
}
|
|
1330
|
-
try {
|
|
1331
|
-
const untracked = execSync('git ls-files --others --exclude-standard', {
|
|
1332
|
-
cwd,
|
|
1333
|
-
encoding: 'utf-8',
|
|
1334
|
-
timeout: 5000,
|
|
1335
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1336
|
-
}).trim();
|
|
1337
|
-
if (untracked) {
|
|
1338
|
-
for (const f of untracked.split('\n')) {
|
|
1339
|
-
if (!f.startsWith('.codeledger/') && !f.startsWith('.claude/'))
|
|
1340
|
-
filesChanged.add(f);
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
catch {
|
|
1345
|
-
// non-fatal
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
const changed = [...filesChanged];
|
|
1349
|
-
const bundleSet = new Set(activation.bundle_files);
|
|
1350
|
-
const overlapping = changed.filter((f) => bundleSet.has(f));
|
|
1351
|
-
const recall = changed.length > 0 ? overlapping.length / changed.length : 0;
|
|
1352
|
-
const precision = activation.bundle_files.length > 0
|
|
1353
|
-
? overlapping.length / activation.bundle_files.length
|
|
1354
|
-
: 0;
|
|
1355
|
-
// Verdict based on F1 thresholds
|
|
1356
|
-
const f1 = (precision + recall) > 0
|
|
1357
|
-
? 2 * (precision * recall) / (precision + recall)
|
|
1358
|
-
: 0;
|
|
1359
|
-
let verdict;
|
|
1360
|
-
if (changed.length === 0) {
|
|
1361
|
-
verdict = 'MISS'; // No files changed — can't evaluate
|
|
1362
|
-
}
|
|
1363
|
-
else if (f1 >= 0.3) {
|
|
1364
|
-
verdict = 'HIT';
|
|
1365
|
-
}
|
|
1366
|
-
else if (recall > 0) {
|
|
1367
|
-
verdict = 'PARTIAL';
|
|
1368
|
-
}
|
|
1369
|
-
else {
|
|
1370
|
-
verdict = 'MISS';
|
|
1371
|
-
}
|
|
1372
|
-
metrics.push({
|
|
1373
|
-
task: activation.task,
|
|
1374
|
-
bundle_id: activation.bundle_id,
|
|
1375
|
-
bundle_file_count: activation.bundle_files.length,
|
|
1376
|
-
bundle_tokens: activation.bundle_tokens,
|
|
1377
|
-
files_changed: changed,
|
|
1378
|
-
files_overlapping: overlapping,
|
|
1379
|
-
recall,
|
|
1380
|
-
precision,
|
|
1381
|
-
verdict,
|
|
1382
|
-
});
|
|
1383
|
-
}
|
|
1384
|
-
return metrics;
|
|
1385
|
-
}
|
|
1386
|
-
/**
|
|
1387
|
-
* Get files changed between two git refs. Returns a mutable set.
|
|
1388
|
-
*/
|
|
1389
|
-
function getFilesChangedBetween(cwd, startRef, endRef) {
|
|
1390
|
-
const files = new Set();
|
|
1391
|
-
try {
|
|
1392
|
-
const diff = execSync(`git diff --name-only ${startRef}..${endRef}`, {
|
|
1393
|
-
cwd,
|
|
1394
|
-
encoding: 'utf-8',
|
|
1395
|
-
timeout: 5000,
|
|
1396
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1397
|
-
}).trim();
|
|
1398
|
-
if (diff) {
|
|
1399
|
-
for (const f of diff.split('\n')) {
|
|
1400
|
-
if (!f.startsWith('.codeledger/') && !f.startsWith('.claude/'))
|
|
1401
|
-
files.add(f);
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
catch {
|
|
1406
|
-
// non-fatal: ref may no longer be valid
|
|
1407
|
-
}
|
|
1408
|
-
return files;
|
|
1409
|
-
}
|
|
1410
|
-
function truncate(s, max) {
|
|
1411
|
-
return s.length <= max ? s : s.slice(0, max - 3) + '...';
|
|
1412
|
-
}
|
|
1413
|
-
//# sourceMappingURL=session-summary.js.map
|