@wooojin/forgen 0.4.13 → 0.5.5
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/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +261 -0
- package/README.ja.md +16 -12
- package/README.ko.md +12 -8
- package/README.md +90 -27
- package/README.zh.md +16 -12
- package/assets/claude/commands/forge-loop.md +7 -1
- package/assets/claude/commands/ship.md +18 -1
- package/assets/opencode/forgen.ts +52 -0
- package/assets/shared/hook-registry.json +210 -22
- package/dist/checks/_shared/meta-guard-dispatch.d.ts +7 -0
- package/dist/checks/_shared/meta-guard-dispatch.js +12 -2
- package/dist/checks/_shared/model-profile.d.ts +25 -0
- package/dist/checks/_shared/model-profile.js +63 -0
- package/dist/cli.js +99 -153
- package/dist/core/auto-compound-runner.d.ts +0 -11
- package/dist/core/auto-compound-runner.js +199 -92
- package/dist/core/changelog-cli.d.ts +4 -1
- package/dist/core/changelog-cli.js +8 -7
- package/dist/core/compound-consent.d.ts +15 -0
- package/dist/core/compound-consent.js +48 -0
- package/dist/core/compound-sweep-cli.d.ts +60 -0
- package/dist/core/compound-sweep-cli.js +374 -0
- package/dist/core/config-injector.d.ts +16 -1
- package/dist/core/config-injector.js +47 -28
- package/dist/core/dashboard-cli.js +40 -16
- package/dist/core/dashboard.d.ts +3 -4
- package/dist/core/dashboard.js +15 -34
- package/dist/core/dev-cli.d.ts +13 -0
- package/dist/core/dev-cli.js +70 -0
- package/dist/core/doctor.d.ts +16 -5
- package/dist/core/doctor.js +190 -176
- package/dist/core/drift-score.d.ts +2 -0
- package/dist/core/drift-score.js +9 -1
- package/dist/core/harness.js +115 -43
- package/dist/core/health-cli.d.ts +2 -0
- package/dist/core/health-cli.js +6 -1
- package/dist/core/host-detect.d.ts +3 -1
- package/dist/core/host-detect.js +26 -1
- package/dist/core/migrate-cli.js +15 -0
- package/dist/core/migrate-evidence-host.d.ts +2 -1
- package/dist/core/migrate-tenetx.d.ts +50 -0
- package/dist/core/migrate-tenetx.js +262 -0
- package/dist/core/probe-workflow-cli.d.ts +3 -3
- package/dist/core/probe-workflow-cli.js +13 -13
- package/dist/core/recall-cli.js +1 -1
- package/dist/core/regress-map-cli.js +1 -1
- package/dist/core/rendered-rules-manifest.d.ts +29 -0
- package/dist/core/rendered-rules-manifest.js +60 -0
- package/dist/core/session-store.js +14 -3
- package/dist/core/settings-injector.d.ts +3 -0
- package/dist/core/settings-injector.js +12 -16
- package/dist/core/spawn.d.ts +37 -1
- package/dist/core/spawn.js +116 -9
- package/dist/core/state-gc.js +1 -0
- package/dist/core/status-cli.d.ts +20 -0
- package/dist/core/status-cli.js +100 -0
- package/dist/core/statusline-cli.d.ts +7 -0
- package/dist/core/statusline-cli.js +63 -19
- package/dist/core/transcript-summary.d.ts +18 -0
- package/dist/core/transcript-summary.js +81 -0
- package/dist/core/trust-layer-intent.d.ts +21 -1
- package/dist/core/trust-layer-intent.js +7 -0
- package/dist/core/types.d.ts +3 -2
- package/dist/core/uninstall.js +12 -0
- package/dist/core/usage-telemetry.d.ts +7 -1
- package/dist/core/usage-telemetry.js +7 -9
- package/dist/core/v1-bootstrap.js +1 -1
- package/dist/core/watch-cli.js +1 -1
- package/dist/engine/compound-extractor.js +10 -0
- package/dist/engine/compound-loop.js +55 -7
- package/dist/engine/compound-share.d.ts +85 -0
- package/dist/engine/compound-share.js +606 -0
- package/dist/engine/correction-cluster-runner.d.ts +38 -0
- package/dist/engine/correction-cluster-runner.js +188 -0
- package/dist/engine/correction-clustering.d.ts +80 -0
- package/dist/engine/correction-clustering.js +167 -0
- package/dist/engine/enforce-classifier.d.ts +10 -1
- package/dist/engine/enforce-classifier.js +111 -22
- package/dist/engine/extraction-session.js +10 -3
- package/dist/engine/private-filter.d.ts +36 -0
- package/dist/engine/private-filter.js +100 -0
- package/dist/engine/ranking-pipeline.js +4 -2
- package/dist/engine/relevance-gate.d.ts +12 -0
- package/dist/engine/relevance-gate.js +12 -0
- package/dist/engine/roi-demotion.d.ts +79 -0
- package/dist/engine/roi-demotion.js +159 -0
- package/dist/engine/solution-format.d.ts +1 -0
- package/dist/engine/solution-format.js +26 -0
- package/dist/engine/solution-matcher.js +10 -1
- package/dist/fgx.js +7 -6
- package/dist/forge/cli.js +8 -2
- package/dist/hooks/compound-reflection.js +6 -1
- package/dist/hooks/context-guard.d.ts +16 -1
- package/dist/hooks/context-guard.js +99 -49
- package/dist/hooks/hook-config.js +5 -0
- package/dist/hooks/hook-registry.d.ts +6 -1
- package/dist/hooks/hooks-generator.js +3 -0
- package/dist/hooks/post-tool-use.js +2 -3
- package/dist/hooks/pre-compact.js +14 -0
- package/dist/hooks/pre-tool-use.js +5 -1
- package/dist/hooks/session-end.d.ts +34 -0
- package/dist/hooks/session-end.js +100 -0
- package/dist/hooks/session-recovery.js +18 -1
- package/dist/hooks/shared/hook-timing.js +6 -1
- package/dist/hooks/shared/stop-triggers.d.ts +29 -2
- package/dist/hooks/shared/stop-triggers.js +35 -2
- package/dist/hooks/solution-injector.d.ts +28 -0
- package/dist/hooks/solution-injector.js +126 -28
- package/dist/hooks/stop-guard.js +5 -2
- package/dist/hooks/subagent-stop-guard.js +4 -1
- package/dist/host/capabilities-claude.js +1 -0
- package/dist/host/capabilities-codex.js +1 -0
- package/dist/host/capabilities-opencode.d.ts +26 -0
- package/dist/host/capabilities-opencode.js +78 -0
- package/dist/host/capabilities-registry.d.ts +7 -0
- package/dist/host/capabilities-registry.js +14 -0
- package/dist/host/codex-rules-context.d.ts +25 -0
- package/dist/host/codex-rules-context.js +62 -0
- package/dist/host/exec-host.d.ts +14 -3
- package/dist/host/exec-host.js +15 -2
- package/dist/host/host-binding.d.ts +27 -0
- package/dist/host/host-binding.js +11 -0
- package/dist/host/host-runtime.js +18 -0
- package/dist/host/install-codex.d.ts +66 -0
- package/dist/host/install-codex.js +293 -25
- package/dist/host/install-opencode.d.ts +38 -0
- package/dist/host/install-opencode.js +148 -0
- package/dist/host/install-orchestrator.d.ts +4 -1
- package/dist/host/install-orchestrator.js +30 -1
- package/dist/host/invoke-agent.d.ts +3 -2
- package/dist/host/invoke-agent.js +1 -0
- package/dist/host/opencode/context-cli.d.ts +15 -0
- package/dist/host/opencode/context-cli.js +25 -0
- package/dist/host/opencode/guard-cli.d.ts +13 -0
- package/dist/host/opencode/guard-cli.js +39 -0
- package/dist/host/opencode/plugin/forgen.d.ts +31 -0
- package/dist/host/opencode/plugin/forgen.js +60 -0
- package/dist/host/opencode/translate.d.ts +49 -0
- package/dist/host/opencode/translate.js +96 -0
- package/dist/host/parity-harness.d.ts +10 -2
- package/dist/host/parity-harness.js +7 -3
- package/dist/host/projection.d.ts +37 -3
- package/dist/host/projection.js +104 -42
- package/dist/mcp/tools.js +17 -4
- package/dist/store/evidence-store.d.ts +2 -6
- package/dist/store/evidence-store.js +164 -46
- package/dist/store/host-mismatch.d.ts +2 -1
- package/dist/store/host-mismatch.js +8 -8
- package/dist/store/profile-store.d.ts +3 -2
- package/dist/store/rule-store.d.ts +41 -0
- package/dist/store/rule-store.js +77 -2
- package/dist/store/types.d.ts +9 -2
- package/hooks/hooks.json +13 -1
- package/package.json +3 -2
- package/plugin.json +2 -2
- package/skills/architecture-decision/SKILL.md +18 -0
- package/skills/calibrate/SKILL.md +18 -0
- package/skills/code-review/SKILL.md +17 -0
- package/skills/compound/SKILL.md +17 -0
- package/skills/deep-interview/SKILL.md +7 -0
- package/skills/docker/SKILL.md +18 -0
- package/skills/forge-loop/SKILL.md +30 -1
- package/skills/learn/SKILL.md +15 -0
- package/skills/retro/SKILL.md +16 -0
- package/skills/ship/SKILL.md +36 -1
package/dist/core/dashboard.js
CHANGED
|
@@ -386,8 +386,7 @@ function renderMultiHost(data) {
|
|
|
386
386
|
return lines.join('\n');
|
|
387
387
|
}
|
|
388
388
|
/**
|
|
389
|
-
*
|
|
390
|
-
* evidence 파일(교정 기록)과 compound 활용률을 교차 분석하여 "쓸수록 나아진다"를 정량화.
|
|
389
|
+
* 교정·활동 요약 수집 (관찰). evidence 파일(교정 기록) 기반. 인과 효과/절약은 미주장.
|
|
391
390
|
*/
|
|
392
391
|
export function collectLearningCurve() {
|
|
393
392
|
const now = Date.now();
|
|
@@ -429,14 +428,15 @@ export function collectLearningCurve() {
|
|
|
429
428
|
}
|
|
430
429
|
}
|
|
431
430
|
catch { /* fail-open */ }
|
|
432
|
-
//
|
|
433
|
-
|
|
431
|
+
// 추세: 전주 대비 카운트 델타의 *관찰* (30%↓=down, 30%↑=up). forgen 인과 효과가
|
|
432
|
+
// 아니라 단순 교정 횟수 변화 — 라벨도 개선/악화(가치 판단)가 아닌 감소/증가로 둔다.
|
|
433
|
+
let correctionTrend = 'flat';
|
|
434
434
|
if (correctionsPrev7d > 0) {
|
|
435
435
|
const delta = (correctionsLast7d - correctionsPrev7d) / correctionsPrev7d;
|
|
436
436
|
if (delta < -0.3)
|
|
437
|
-
correctionTrend = '
|
|
437
|
+
correctionTrend = 'down';
|
|
438
438
|
else if (delta > 0.3)
|
|
439
|
-
correctionTrend = '
|
|
439
|
+
correctionTrend = 'up';
|
|
440
440
|
}
|
|
441
441
|
// 상위 교정 축
|
|
442
442
|
const topCorrectionAxes = Array.from(axisCounts.entries())
|
|
@@ -445,59 +445,40 @@ export function collectLearningCurve() {
|
|
|
445
445
|
.map(([axis, count]) => ({ axis, count }));
|
|
446
446
|
// 세션 수: evidence 날짜 기준 (고유 날짜 × 평균 2세션/일 가정)
|
|
447
447
|
const sessionsAnalyzed = uniqueDays.size * 2;
|
|
448
|
-
//
|
|
449
|
-
// (경쟁자 분석에서 도출한 경험적 수치 — 카운터팩추얼의 하한 추정)
|
|
450
|
-
const injection = collectInjectionActivity();
|
|
451
|
-
let successfulInjections = 0;
|
|
452
|
-
try {
|
|
453
|
-
for (const rec of injection.recentInjections ?? []) {
|
|
454
|
-
const ts = new Date(rec.ts).getTime();
|
|
455
|
-
if (Number.isFinite(ts) && now - ts < SEVEN_DAYS_MS)
|
|
456
|
-
successfulInjections++;
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
catch { /* fail-open */ }
|
|
460
|
-
const estimatedMinutesSaved = Math.round(successfulInjections * 8);
|
|
448
|
+
// (은퇴) estimatedMinutesSaved: "주입당 8분 절약" 카운터팩추얼은 honest-null 로 제거.
|
|
461
449
|
return {
|
|
462
450
|
correctionsLast7d,
|
|
463
451
|
correctionsPrev7d,
|
|
464
452
|
correctionTrend,
|
|
465
453
|
evidenceTotalDays: uniqueDays.size,
|
|
466
454
|
sessionsAnalyzed,
|
|
467
|
-
estimatedMinutesSaved,
|
|
468
455
|
topCorrectionAxes,
|
|
469
456
|
};
|
|
470
457
|
}
|
|
471
458
|
function renderLearningCurve(data) {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
459
|
+
// 관찰: 교정 카운트 델타. 개선/악화 색(가치 판단) 대신 중립 감소/증가 표기.
|
|
460
|
+
const trendIcon = data.correctionTrend === 'down'
|
|
461
|
+
? dim('↓ 감소')
|
|
462
|
+
: data.correctionTrend === 'up'
|
|
463
|
+
? dim('↑ 증가')
|
|
476
464
|
: dim('→ 유지');
|
|
477
465
|
const axisLines = data.topCorrectionAxes.length > 0
|
|
478
466
|
? data.topCorrectionAxes.map(a => ` ${a.axis}: ${a.count}회`).join('\n')
|
|
479
467
|
: ` ${dim('(아직 교정 데이터 없음)')}`;
|
|
480
|
-
const savedHours = Math.floor(data.estimatedMinutesSaved / 60);
|
|
481
|
-
const savedMins = data.estimatedMinutesSaved % 60;
|
|
482
|
-
const savedStr = savedHours > 0 ? `${savedHours}시간 ${savedMins}분` : `${savedMins}분`;
|
|
483
468
|
return [
|
|
484
|
-
` ${bold('
|
|
469
|
+
` ${bold('📊 교정·활동 요약')} ${dim('(관찰 — 인과 효과/절약 미주장)')}`,
|
|
485
470
|
``,
|
|
486
471
|
` 교정 추이 (지난 7일):`,
|
|
487
472
|
` 이번 주: ${data.correctionsLast7d}건`,
|
|
488
473
|
` 지난 주: ${data.correctionsPrev7d}건`,
|
|
489
|
-
`
|
|
474
|
+
` 카운트 변화: ${trendIcon} ${dim('(관찰치, forgen 효과 아님)')}`,
|
|
490
475
|
``,
|
|
491
476
|
` 주요 교정 축 (누적):`,
|
|
492
477
|
axisLines,
|
|
493
478
|
``,
|
|
494
|
-
` 누적
|
|
479
|
+
` 누적 활동:`,
|
|
495
480
|
` 활동한 일수: ${data.evidenceTotalDays}일`,
|
|
496
481
|
` 분석된 세션: 약 ${data.sessionsAnalyzed}회`,
|
|
497
|
-
``,
|
|
498
|
-
` ${cyan('추정 절약 시간')} (compound 주입 성공 기반):`,
|
|
499
|
-
` ${bold(savedStr)} ${dim('(지난 7일)')}`,
|
|
500
|
-
` ${dim('※ compound가 힌트를 제공한 매 1회당 평균 8분 절약 가정')}`,
|
|
501
482
|
].join('\n');
|
|
502
483
|
}
|
|
503
484
|
function renderFitnessSummary() {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* forgen dev — 개발/유지보수 명령 네임스페이스 (Wave 1 W1-3, feature-audit 2026-07-21).
|
|
3
|
+
*
|
|
4
|
+
* probe-workflow / parity / migrate / regress-map 은 개발·CI·스키마 유지보수용으로,
|
|
5
|
+
* 일반 사용자 표면(top-level)을 어지럽혔다. `forgen dev <sub>` 하나로 모아 사용자
|
|
6
|
+
* 명령 표면을 정리한다. 각 핸들러는 기존 것을 재사용.
|
|
7
|
+
*
|
|
8
|
+
* forgen dev probe-workflow arm|report|status ADR-009 §1 훅 발화 측정
|
|
9
|
+
* forgen dev parity codex [--dry-run] host parity (source 체크아웃 전용)
|
|
10
|
+
* forgen dev migrate [implicit-feedback|...] one-shot 스키마 마이그레이션
|
|
11
|
+
* forgen dev regress-map [--days N --top N] 최근 fix 집중 파일
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleDev(args: string[]): Promise<void>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* forgen dev — 개발/유지보수 명령 네임스페이스 (Wave 1 W1-3, feature-audit 2026-07-21).
|
|
3
|
+
*
|
|
4
|
+
* probe-workflow / parity / migrate / regress-map 은 개발·CI·스키마 유지보수용으로,
|
|
5
|
+
* 일반 사용자 표면(top-level)을 어지럽혔다. `forgen dev <sub>` 하나로 모아 사용자
|
|
6
|
+
* 명령 표면을 정리한다. 각 핸들러는 기존 것을 재사용.
|
|
7
|
+
*
|
|
8
|
+
* forgen dev probe-workflow arm|report|status ADR-009 §1 훅 발화 측정
|
|
9
|
+
* forgen dev parity codex [--dry-run] host parity (source 체크아웃 전용)
|
|
10
|
+
* forgen dev migrate [implicit-feedback|...] one-shot 스키마 마이그레이션
|
|
11
|
+
* forgen dev regress-map [--days N --top N] 최근 fix 집중 파일
|
|
12
|
+
*/
|
|
13
|
+
import * as fs from 'node:fs';
|
|
14
|
+
import * as path from 'node:path';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
16
|
+
function printDevHelp() {
|
|
17
|
+
console.log(`
|
|
18
|
+
forgen dev — developer / maintenance utilities
|
|
19
|
+
|
|
20
|
+
forgen dev probe-workflow arm|report|status Measure hook firing in dynamic-workflow subagents (ADR-009 §1)
|
|
21
|
+
forgen dev parity codex [--dry-run] Host parity checks (source checkout only)
|
|
22
|
+
forgen dev migrate [target] One-shot schema migration
|
|
23
|
+
forgen dev regress-map [--days N --top N] Top fix-touched files
|
|
24
|
+
`);
|
|
25
|
+
}
|
|
26
|
+
async function runParity(args) {
|
|
27
|
+
const sub = args[0];
|
|
28
|
+
if (sub !== 'codex') {
|
|
29
|
+
console.log('Usage:\n forgen dev parity codex [--dry-run]\n\nNotes:\n - source 체크아웃에서만 작동합니다 (tests/ 디렉토리 필요).\n - npm install 로 설치된 패키지에서는 run-parity.sh 가 없습니다.');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const here = path.dirname(fileURLToPath(import.meta.url)); // dist/core
|
|
33
|
+
const scriptPath = path.resolve(here, '..', '..', 'tests', 'e2e', 'codex', 'run-parity.sh');
|
|
34
|
+
if (!fs.existsSync(scriptPath)) {
|
|
35
|
+
console.error('[forgen] run-parity.sh 는 source 체크아웃에서만 작동. 직접 git clone 후 실행하세요.');
|
|
36
|
+
console.error(` expected: ${scriptPath}`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
const { spawnSync } = await import('node:child_process');
|
|
40
|
+
const dryRun = args.includes('--dry-run');
|
|
41
|
+
const result = spawnSync('bash', [scriptPath, ...(dryRun ? ['--dry-run'] : [])], { stdio: 'inherit' });
|
|
42
|
+
if (result.status !== 0)
|
|
43
|
+
process.exit(result.status ?? 1);
|
|
44
|
+
}
|
|
45
|
+
export async function handleDev(args) {
|
|
46
|
+
const sub = args[0];
|
|
47
|
+
const rest = args.slice(1);
|
|
48
|
+
switch (sub) {
|
|
49
|
+
case 'probe-workflow': {
|
|
50
|
+
const { handleProbeWorkflow } = await import('./probe-workflow-cli.js');
|
|
51
|
+
await handleProbeWorkflow(rest);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
case 'parity':
|
|
55
|
+
await runParity(rest);
|
|
56
|
+
return;
|
|
57
|
+
case 'migrate': {
|
|
58
|
+
const { handleMigrate } = await import('./migrate-cli.js');
|
|
59
|
+
await handleMigrate(rest);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
case 'regress-map': {
|
|
63
|
+
const { handleRegressMap } = await import('./regress-map-cli.js');
|
|
64
|
+
await handleRegressMap(rest);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
default:
|
|
68
|
+
printDevHelp();
|
|
69
|
+
}
|
|
70
|
+
}
|
package/dist/core/doctor.d.ts
CHANGED
|
@@ -4,16 +4,27 @@ export interface DoctorOptions {
|
|
|
4
4
|
pruneState?: boolean;
|
|
5
5
|
/**
|
|
6
6
|
* When true, auto-fix recoverable failures (e.g. missing plugin cache /
|
|
7
|
-
* stale installPath) by running `
|
|
8
|
-
*
|
|
7
|
+
* stale installPath) by running `node scripts/postinstall.js` inside the
|
|
8
|
+
* forgen install directory (`npm run build` 는 dist 부재 시에만 — W1-4).
|
|
9
|
+
* Triggered by `forgen doctor --repair`.
|
|
9
10
|
*
|
|
10
|
-
* v0.4.8 (E3) — 이전엔
|
|
11
|
-
*
|
|
12
|
-
* doctor 흐름은 정상 종료.
|
|
11
|
+
* v0.4.8 (E3) — 이전엔 안내문만 출력. fail-open: repair 실패해도 doctor
|
|
12
|
+
* 흐름은 정상 종료. W1-4 (ADR-010) — 실행 사실이 아니라 재검증 결과를 보고.
|
|
13
13
|
*/
|
|
14
14
|
repair?: boolean;
|
|
15
15
|
/** When true, run only essential checks (Tools + Plugins + Directories +
|
|
16
16
|
* Initialization Status) for fast onboarding verification. ~10 lines output. */
|
|
17
17
|
quick?: boolean;
|
|
18
|
+
/** W1-1 (ADR-010): tenetx/legacy 규칙 스프롤 스캔 (dry-run — 삭제는
|
|
19
|
+
* `forgen migrate tenetx` 가 수행). native /doctor 가 비용을 flag 하면
|
|
20
|
+
* forgen 이 provenance 로 안전하게 회수하는 보완 관계. */
|
|
21
|
+
reclaim?: boolean;
|
|
22
|
+
/** W2-1 (ADR-010): hook timing 표 등 상세 진단 표시. slow-hook 감지는
|
|
23
|
+
* native /doctor 영역이라 기본 출력에서 강등됨 (수집은 유지). */
|
|
24
|
+
verbose?: boolean;
|
|
18
25
|
}
|
|
26
|
+
/** plugin cache 디렉토리에 버전 엔트리가 하나 이상 있는가 (check + repair 재검증 공용) */
|
|
27
|
+
export declare function pluginCacheOk(): boolean;
|
|
28
|
+
/** installed_plugins.json 의 forgen entry 가 존재하며 installPath 가 살아있는가 */
|
|
29
|
+
export declare function pluginRegisteredOk(): boolean;
|
|
19
30
|
export declare function runDoctor(opts?: DoctorOptions): Promise<void>;
|