codehere 1.0.1 → 1.0.2
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/README.md +36 -192
- package/dist/application/use-cases/check-claimed-tests.js +81 -0
- package/dist/application/use-cases/detect-test-weakening.js +237 -0
- package/dist/application/use-cases/rerun-tests.js +110 -7
- package/dist/index.js +38 -1212
- package/dist/infrastructure/orchestration/artifacts-extractor.js +2 -323
- package/dist/presentation/cli/commands/check-command.js +178 -23
- package/dist/presentation/cli/commands/help-command.js +21 -285
- package/dist/ui.js +5 -236
- package/dist/utils/version.js +0 -6
- package/package.json +9 -38
- package/dist/application/services/verdict-service.js +0 -154
- package/dist/application/use-cases/assess-cross-vendor.js +0 -126
- package/dist/application/use-cases/build-cross-vendor-verdict.js +0 -118
- package/dist/application/use-cases/domain-trust.js +0 -110
- package/dist/application/use-cases/export-aat.js +0 -107
- package/dist/application/use-cases/generate-acceptance-criteria.js +0 -223
- package/dist/application/use-cases/generate-final-report.js +0 -259
- package/dist/application/use-cases/generate-narration.js +0 -130
- package/dist/application/use-cases/generate-thread-title.js +0 -181
- package/dist/application/use-cases/narrator-prompt-template.js +0 -158
- package/dist/application/use-cases/plan-auto-review.js +0 -57
- package/dist/application/use-cases/reconcile-audit.js +0 -100
- package/dist/application/use-cases/search-sessions.js +0 -70
- package/dist/application/use-cases/should-auto-review.js +0 -71
- package/dist/application/use-cases/thread-export.js +0 -245
- package/dist/application/use-cases/verify-claim.js +0 -456
- package/dist/application/use-cases/write-pass.js +0 -277
- package/dist/domain/audit.js +0 -11
- package/dist/domain/services/codebase-detector.js +0 -85
- package/dist/domain/task.js +0 -91
- package/dist/error-handler.js +0 -139
- package/dist/infrastructure/completion/bash-completion.js +0 -29
- package/dist/infrastructure/completion/fish-completion.js +0 -17
- package/dist/infrastructure/completion/zsh-completion.js +0 -25
- package/dist/infrastructure/config/config-manager.js +0 -174
- package/dist/infrastructure/config/product-context.js +0 -49
- package/dist/infrastructure/context/adapters/drawio-source.js +0 -157
- package/dist/infrastructure/context/adapters/figma-source.js +0 -198
- package/dist/infrastructure/context/adapters/github-issue-source.js +0 -160
- package/dist/infrastructure/context/adapters/linear-source.js +0 -190
- package/dist/infrastructure/context/context-resolver.js +0 -144
- package/dist/infrastructure/context/context-source.js +0 -114
- package/dist/infrastructure/context/github-api.js +0 -110
- package/dist/infrastructure/context/github-device-flow.js +0 -65
- package/dist/infrastructure/context/oauth-flow.js +0 -207
- package/dist/infrastructure/context/oauth-store.js +0 -122
- package/dist/infrastructure/context/registry-bootstrap.js +0 -95
- package/dist/infrastructure/context/write-pass-resolver.js +0 -106
- package/dist/infrastructure/cost/budget-config.js +0 -114
- package/dist/infrastructure/cost/cost-router.js +0 -97
- package/dist/infrastructure/cost/spend-aggregator.js +0 -222
- package/dist/infrastructure/cost/team-ledger.js +0 -355
- package/dist/infrastructure/discovery/discovery-log.js +0 -85
- package/dist/infrastructure/hooks/audit-tip-signature.js +0 -336
- package/dist/infrastructure/hooks/claude-sdk-hook.js +0 -1018
- package/dist/infrastructure/hooks/hook-mode.js +0 -87
- package/dist/infrastructure/hooks/mirror-tool-call-to-audit.js +0 -49
- package/dist/infrastructure/hooks/pre-prompt-scan.js +0 -122
- package/dist/infrastructure/hooks/session-analyzer.js +0 -177
- package/dist/infrastructure/observability/execution-tracer.js +0 -227
- package/dist/infrastructure/orchestration/agent-adapter.js +0 -13
- package/dist/infrastructure/orchestration/agent-installer.js +0 -101
- package/dist/infrastructure/orchestration/agents-config-seed.js +0 -68
- package/dist/infrastructure/orchestration/aider-adapter.js +0 -611
- package/dist/infrastructure/orchestration/cassette-recorder.js +0 -120
- package/dist/infrastructure/orchestration/claude-code-adapter.js +0 -592
- package/dist/infrastructure/orchestration/codex-adapter.js +0 -574
- package/dist/infrastructure/orchestration/conductor-adapter.js +0 -416
- package/dist/infrastructure/orchestration/context-handoff.js +0 -162
- package/dist/infrastructure/orchestration/control/codex-control-surface.js +0 -99
- package/dist/infrastructure/orchestration/control/control-surface.js +0 -15
- package/dist/infrastructure/orchestration/detect-ollama.js +0 -75
- package/dist/infrastructure/orchestration/failover-classifier.js +0 -151
- package/dist/infrastructure/orchestration/failover-config.js +0 -67
- package/dist/infrastructure/orchestration/failover-policy.js +0 -106
- package/dist/infrastructure/orchestration/gemini-adapter.js +0 -663
- package/dist/infrastructure/orchestration/generic-cli-adapter.js +0 -689
- package/dist/infrastructure/orchestration/graphify-context.js +0 -209
- package/dist/infrastructure/orchestration/memory-injector.js +0 -380
- package/dist/infrastructure/orchestration/mocks/mock-agent-repl.js +0 -388
- package/dist/infrastructure/orchestration/mocks/mock-codex-app-server.js +0 -73
- package/dist/infrastructure/orchestration/mocks/mock-synthesis.js +0 -83
- package/dist/infrastructure/orchestration/mocks/resolve-agent-spawn.js +0 -37
- package/dist/infrastructure/orchestration/opencode-adapter.js +0 -580
- package/dist/infrastructure/orchestration/progress-aggregator.js +0 -906
- package/dist/infrastructure/orchestration/readiness.js +0 -103
- package/dist/infrastructure/orchestration/session-manager.js +0 -1590
- package/dist/infrastructure/orchestration/session-persistence.js +0 -394
- package/dist/infrastructure/orchestration/thread-key-store.js +0 -127
- package/dist/infrastructure/orchestration/write-pass-store.js +0 -38
- package/dist/infrastructure/protocols/cloud-sync.js +0 -207
- package/dist/infrastructure/protocols/mcp-helpers.js +0 -25
- package/dist/infrastructure/protocols/mcp-server-impl.js +0 -3935
- package/dist/infrastructure/protocols/mcp-tools.js +0 -401
- package/dist/infrastructure/protocols/probe-port.js +0 -36
- package/dist/infrastructure/protocols/thread-phase.js +0 -105
- package/dist/infrastructure/protocols/ui/app-script-artifacts.js +0 -121
- package/dist/infrastructure/protocols/ui/app-script-audit-footer.js +0 -44
- package/dist/infrastructure/protocols/ui/app-script-audit-verify.js +0 -56
- package/dist/infrastructure/protocols/ui/app-script-composer-cost.js +0 -588
- package/dist/infrastructure/protocols/ui/app-script-context-sources.js +0 -168
- package/dist/infrastructure/protocols/ui/app-script-conversation.js +0 -67
- package/dist/infrastructure/protocols/ui/app-script-drawer.js +0 -115
- package/dist/infrastructure/protocols/ui/app-script-failover.js +0 -133
- package/dist/infrastructure/protocols/ui/app-script-github.js +0 -113
- package/dist/infrastructure/protocols/ui/app-script-observer.js +0 -104
- package/dist/infrastructure/protocols/ui/app-script-onboarding.js +0 -80
- package/dist/infrastructure/protocols/ui/app-script-overlay.js +0 -203
- package/dist/infrastructure/protocols/ui/app-script-recovery.js +0 -136
- package/dist/infrastructure/protocols/ui/app-script-render.js +0 -166
- package/dist/infrastructure/protocols/ui/app-script-share.js +0 -78
- package/dist/infrastructure/protocols/ui/app-script-sidebar.js +0 -194
- package/dist/infrastructure/protocols/ui/app-script-tour.js +0 -78
- package/dist/infrastructure/protocols/ui/app-script-wpass.js +0 -312
- package/dist/infrastructure/protocols/ui/app-script.js +0 -2998
- package/dist/infrastructure/protocols/ui/font-faces.js +0 -7
- package/dist/infrastructure/protocols/ui/styles.js +0 -2147
- package/dist/infrastructure/protocols/ui/tokens.js +0 -96
- package/dist/infrastructure/protocols/ui-page-v2.js +0 -320
- package/dist/infrastructure/protocols/verify-page.js +0 -1677
- package/dist/infrastructure/security/file-collection.js +0 -118
- package/dist/infrastructure/security/fix-code.js +0 -144
- package/dist/infrastructure/security/fix-secret.js +0 -89
- package/dist/infrastructure/security/permissions-config.js +0 -235
- package/dist/infrastructure/security/scan-types.js +0 -10
- package/dist/infrastructure/security/ship-scan.js +0 -195
- package/dist/infrastructure/security/trust-scorer.js +0 -724
- package/dist/infrastructure/security/vibe-checks.js +0 -99
- package/dist/infrastructure/storage/atomic-write.js +0 -86
- package/dist/infrastructure/storage/cross-tool-agents.js +0 -268
- package/dist/infrastructure/storage/project-thread-migration.js +0 -237
- package/dist/infrastructure/storage/project-thread-mirror.js +0 -671
- package/dist/infrastructure/storage/project-thread-reader.js +0 -409
- package/dist/infrastructure/storage/project-thread-title-backfill.js +0 -214
- package/dist/monitoring.js +0 -212
- package/dist/presentation/cli/commands/audit-command.js +0 -201
- package/dist/presentation/cli/commands/budget-command.js +0 -79
- package/dist/presentation/cli/commands/config-command.js +0 -125
- package/dist/presentation/cli/commands/context-source-command.js +0 -217
- package/dist/presentation/cli/commands/hook-command.js +0 -265
- package/dist/presentation/cli/commands/init-command.js +0 -590
- package/dist/presentation/cli/commands/memory-command.js +0 -1031
- package/dist/presentation/cli/commands/narrator-command.js +0 -101
- package/dist/presentation/cli/commands/permission-command.js +0 -105
- package/dist/presentation/cli/commands/protocols-builder.js +0 -254
- package/dist/presentation/cli/commands/protocols-command.js +0 -84
- package/dist/presentation/cli/commands/repo-map-builder.js +0 -247
- package/dist/presentation/cli/commands/report-command.js +0 -403
- package/dist/presentation/cli/commands/scan-command.js +0 -52
- package/dist/presentation/cli/commands/scan-tool-command.js +0 -110
- package/dist/presentation/cli/commands/search-command.js +0 -51
- package/dist/presentation/cli/commands/setup-command.js +0 -330
- package/dist/presentation/cli/commands/status-command.js +0 -614
- package/dist/presentation/cli/commands/team-command.js +0 -256
- package/dist/presentation/cli/commands/thread-command.js +0 -370
- package/dist/presentation/cli/commands/trust-command.js +0 -328
- package/dist/presentation/cli/commands/verify-command.js +0 -298
- package/dist/presentation/cli/error-display.js +0 -328
- package/dist/presentation/cli/repl.js +0 -805
- package/dist/presentation/cli/task-deliverable.js +0 -153
- package/dist/testing/cassette.js +0 -125
- package/dist/testing/replay-adapter.js +0 -147
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* cassette-recorder · organic instrumentation for S2b of the capture-first plan.
|
|
3
|
-
*
|
|
4
|
-
* What it does:
|
|
5
|
-
* When CODEHERE_RECORD_CASSETTES=1 is set, every adapter spawn writes the
|
|
6
|
-
* raw stdout/stderr byte stream + exit to a JSONL cassette under
|
|
7
|
-
* ~/.codehere/cassettes/<adapter>/<scenario>-<ISO>.jsonl. The schema matches
|
|
8
|
-
* the locked L3b format (agent/src/testing/cassette.ts) so the same loader
|
|
9
|
-
* + replay infrastructure works on captures from real production sessions.
|
|
10
|
-
*
|
|
11
|
-
* Why this exists:
|
|
12
|
-
* Per chat 2026-05-23 (path 3 hybrid), we agreed cassettes accumulate from
|
|
13
|
-
* the founder's normal use rather than from dedicated capture sessions
|
|
14
|
-
* requiring fresh API keys. This module is the "accumulates" mechanism.
|
|
15
|
-
*
|
|
16
|
-
* Design choices:
|
|
17
|
-
* - OFF by default. Zero overhead when the env var is unset. The 5 adapters
|
|
18
|
-
* all call `startRecording()`, but it returns a no-op recorder if the
|
|
19
|
-
* env var isn't set, so the per-chunk hooks become free function calls.
|
|
20
|
-
* - Best-effort writes. A failed cassette never breaks the spawn path.
|
|
21
|
-
* - No PII scrubbing here · the user is recording their own sessions on
|
|
22
|
-
* their own machine. If we ever publish cassettes externally, scrubbing
|
|
23
|
-
* belongs in an export tool, not in the recorder.
|
|
24
|
-
* - One cassette per session (no append between sessions). Easier to reason
|
|
25
|
-
* about lifecycle, easier to discard / re-run, easier to ship in a PR.
|
|
26
|
-
*/
|
|
27
|
-
import { appendFileSync, mkdirSync } from 'fs';
|
|
28
|
-
import { homedir } from 'os';
|
|
29
|
-
import { dirname, join } from 'path';
|
|
30
|
-
const ENV_FLAG = 'CODEHERE_RECORD_CASSETTES';
|
|
31
|
-
const NULL_RECORDER = {
|
|
32
|
-
enabled: false,
|
|
33
|
-
path: '',
|
|
34
|
-
onStdout() { },
|
|
35
|
-
onStderr() { },
|
|
36
|
-
onExit() { },
|
|
37
|
-
};
|
|
38
|
-
export function startRecording(opts) {
|
|
39
|
-
if (process.env[ENV_FLAG] !== '1')
|
|
40
|
-
return NULL_RECORDER;
|
|
41
|
-
const outDir = opts.outDir ?? join(process.env.CODEHERE_HOME || homedir(), '.codehere', 'cassettes', opts.adapter);
|
|
42
|
-
const scenario = `organic-${opts.sessionId.slice(0, 8)}`;
|
|
43
|
-
const stamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
44
|
-
const path = join(outDir, `${scenario}-${stamp}.jsonl`);
|
|
45
|
-
try {
|
|
46
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
return NULL_RECORDER;
|
|
50
|
-
}
|
|
51
|
-
const start = Date.now();
|
|
52
|
-
const header = {
|
|
53
|
-
t: 0,
|
|
54
|
-
meta: {
|
|
55
|
-
adapter: opts.adapter,
|
|
56
|
-
scenario,
|
|
57
|
-
captured_at: new Date().toISOString(),
|
|
58
|
-
binary_version: opts.binary_version ?? 'unknown',
|
|
59
|
-
origin: 'real',
|
|
60
|
-
prompt: opts.prompt,
|
|
61
|
-
cwd_hint: hintCwd(opts.cwd),
|
|
62
|
-
schema: 1,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
try {
|
|
66
|
-
appendFileSync(path, JSON.stringify(header) + '\n', 'utf-8');
|
|
67
|
-
}
|
|
68
|
-
catch {
|
|
69
|
-
return NULL_RECORDER;
|
|
70
|
-
}
|
|
71
|
-
let sealed = false;
|
|
72
|
-
return {
|
|
73
|
-
enabled: true,
|
|
74
|
-
path,
|
|
75
|
-
onStdout(chunk) {
|
|
76
|
-
if (sealed)
|
|
77
|
-
return;
|
|
78
|
-
writeEvent(path, { t: Date.now() - start, stream: 'stdout', data: chunk });
|
|
79
|
-
},
|
|
80
|
-
onStderr(chunk) {
|
|
81
|
-
if (sealed)
|
|
82
|
-
return;
|
|
83
|
-
writeEvent(path, { t: Date.now() - start, stream: 'stderr', data: chunk });
|
|
84
|
-
},
|
|
85
|
-
onExit(exit_code, signal) {
|
|
86
|
-
if (sealed)
|
|
87
|
-
return;
|
|
88
|
-
sealed = true;
|
|
89
|
-
writeEvent(path, { t: Date.now() - start, exit_code, signal });
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
/* ──────────────────────────────────────────────────────────────────────── */
|
|
94
|
-
/* Internals */
|
|
95
|
-
/* ──────────────────────────────────────────────────────────────────────── */
|
|
96
|
-
function writeEvent(path, payload) {
|
|
97
|
-
try {
|
|
98
|
-
appendFileSync(path, JSON.stringify(payload) + '\n', 'utf-8');
|
|
99
|
-
}
|
|
100
|
-
catch {
|
|
101
|
-
// best-effort · never break the spawn path
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function hintCwd(cwd) {
|
|
105
|
-
if (!cwd)
|
|
106
|
-
return '.';
|
|
107
|
-
const home = homedir();
|
|
108
|
-
if (cwd === home)
|
|
109
|
-
return '~';
|
|
110
|
-
if (cwd.startsWith(home + '/'))
|
|
111
|
-
return '~/' + cwd.slice(home.length + 1);
|
|
112
|
-
return cwd;
|
|
113
|
-
}
|
|
114
|
-
/** Probe used by tests + the future status command. */
|
|
115
|
-
export function isRecordingEnabled() {
|
|
116
|
-
return process.env[ENV_FLAG] === '1';
|
|
117
|
-
}
|
|
118
|
-
/** Returns the env flag name so callers can document it consistently. */
|
|
119
|
-
export const RECORD_ENV_FLAG = ENV_FLAG;
|
|
120
|
-
//# sourceMappingURL=cassette-recorder.js.map
|