dorfl 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advance-drivers.d.ts +1 -1
- package/dist/advance-lifecycle-template.js +6 -6
- package/dist/advance-lifecycle-template.js.map +1 -1
- package/dist/brand.d.ts +1 -1
- package/dist/brand.js +1 -1
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +119 -11
- package/dist/cli.js.map +1 -1
- package/dist/config-override.d.ts +1 -1
- package/dist/do-autopick.d.ts +1 -1
- package/dist/do-config.d.ts.map +1 -1
- package/dist/do-config.js +1 -1
- package/dist/do-config.js.map +1 -1
- package/dist/env-config.d.ts +1 -1
- package/dist/env-config.js +1 -1
- package/dist/identity.d.ts +1 -1
- package/dist/install-ci.js +2 -2
- package/dist/install-ci.js.map +1 -1
- package/dist/intake-trigger-template.js +2 -2
- package/dist/lifecycle-pools.d.ts +1 -1
- package/dist/mirror-pool-scan.d.ts +2 -2
- package/dist/mirror-pool-scan.js +1 -1
- package/dist/mirror-pool-scan.js.map +1 -1
- package/dist/prd-to-spec.d.ts +8 -57
- package/dist/prd-to-spec.d.ts.map +1 -1
- package/dist/prd-to-spec.js +17 -99
- package/dist/prd-to-spec.js.map +1 -1
- package/dist/protocol/WORK-CONTRACT.md +1 -1
- package/dist/repo-config.d.ts +11 -11
- package/dist/repo-config.d.ts.map +1 -1
- package/dist/repo-config.js +9 -9
- package/dist/repo-mirror.d.ts +6 -6
- package/dist/repo-mirror.d.ts.map +1 -1
- package/dist/repo-mirror.js +6 -6
- package/dist/repo-mirror.js.map +1 -1
- package/dist/resync-protocol.d.ts +73 -0
- package/dist/resync-protocol.d.ts.map +1 -0
- package/dist/resync-protocol.js +114 -0
- package/dist/resync-protocol.js.map +1 -0
- package/dist/run.d.ts +1 -1
- package/dist/run.js +1 -1
- package/dist/run.js.map +1 -1
- package/dist/scan.d.ts +2 -2
- package/dist/scan.js +5 -5
- package/dist/scan.js.map +1 -1
- package/dist/skills/convert-from-prd-to-spec/SKILL.md +2 -2
- package/dist/skills/drive-tasks/SKILL.md +1 -1
- package/dist/skills/from-idea/SKILL.md +2 -2
- package/dist/skills/setup/SKILL.md +2 -2
- package/dist/skills/setup/protocol/WORK-CONTRACT.md +1 -1
- package/dist/verify-workflow-template.d.ts +1 -1
- package/dist/verify-workflow-template.js +1 -1
- package/package.json +1 -1
- package/src/advance-drivers.ts +1 -1
- package/src/advance-lifecycle-template.ts +6 -6
- package/src/brand.ts +1 -1
- package/src/cli.ts +168 -11
- package/src/config-override.ts +1 -1
- package/src/do-autopick.ts +1 -1
- package/src/do-config.ts +1 -1
- package/src/env-config.ts +1 -1
- package/src/identity.ts +1 -1
- package/src/install-ci.ts +2 -2
- package/src/intake-trigger-template.ts +2 -2
- package/src/lifecycle-pools.ts +1 -1
- package/src/mirror-pool-scan.ts +3 -3
- package/src/prd-to-spec.ts +26 -148
- package/src/repo-config.ts +11 -11
- package/src/repo-mirror.ts +7 -7
- package/src/resync-protocol.ts +162 -0
- package/src/run.ts +2 -2
- package/src/scan.ts +5 -5
- package/src/verify-workflow-template.ts +1 -1
|
@@ -67,7 +67,7 @@ export interface PerformAdvanceMultiOptions extends SharedAdvanceContext {
|
|
|
67
67
|
/**
|
|
68
68
|
* The per-machine {@link ConfigOverrideMap}. Threaded into the in-place pool
|
|
69
69
|
* scan (`scanRepoPaths`) so the per-machine override applies to advance
|
|
70
|
-
* autopick eligibility — WITHOUT it the committed
|
|
70
|
+
* autopick eligibility — WITHOUT it the committed `dorfl.json` silently
|
|
71
71
|
* beats the override on this path (the in-place advance autopick mirror of the
|
|
72
72
|
* `do` autopick defect).
|
|
73
73
|
*/
|
|
@@ -166,7 +166,7 @@ on:
|
|
|
166
166
|
# Override an engine gate for THIS manual run only, riding the env layer of
|
|
167
167
|
# flag > env > per-repo > global > default. Modelled as \`type: choice\` with a
|
|
168
168
|
# BLANK first option (not \`type: boolean\`, which cannot represent "unset"):
|
|
169
|
-
# blank ⇒ emit NOTHING (the committed
|
|
169
|
+
# blank ⇒ emit NOTHING (the committed dorfl.json wins, today's
|
|
170
170
|
# behaviour); a non-blank choice ⇒ export the matching DORFL_* for this
|
|
171
171
|
# run. The blank is load-bearing: env-config coercion THROWS on an empty
|
|
172
172
|
# string, so the per-job step below only writes when the input is non-blank.
|
|
@@ -237,11 +237,11 @@ env:
|
|
|
237
237
|
# ── The engine GATE FAMILY is resolved FROM CONFIG, not carried here ─────────
|
|
238
238
|
# CI is NOT a special policy surface (ADR ci-config-policy-and-gate-family §5):
|
|
239
239
|
# it runs the SAME engine gates, resolved through flag > env > per-repo > global
|
|
240
|
-
# > default. The SAME
|
|
240
|
+
# > default. The SAME dorfl.json the laptop uses applies here. This
|
|
241
241
|
# workflow emits NO DORFL_AUTO_BUILD / DORFL_AUTO_TASK /
|
|
242
242
|
# DORFL_OBSERVATION_TRIAGE / DORFL_SURFACE_BLOCKERS line on a
|
|
243
243
|
# SCHEDULE/PUSH tick, so the env layer carries NO defaults there — your committed
|
|
244
|
-
#
|
|
244
|
+
# dorfl.json wins (then the global config, then the strict built-in
|
|
245
245
|
# defaults autoBuild:false / autoTask:false / observationTriage:'off' /
|
|
246
246
|
# surfaceBlockers:false). The ONE exception is a manual \`workflow_dispatch\` where
|
|
247
247
|
# you fill a gate override input (above): the per-job step then exports that ONE
|
|
@@ -250,7 +250,7 @@ env:
|
|
|
250
250
|
# \`enumerate\` scan (it gates the matrix pools via observationTriage/surfaceBlockers
|
|
251
251
|
# /autoTask/autoBuild), not just the agent-running jobs — or the override is inert
|
|
252
252
|
# for the very pools it targets. To enable CI autonomy durably, set the gate(s) in
|
|
253
|
-
#
|
|
253
|
+
# dorfl.json (applies everywhere) — NOT by re-running install-ci (ADR §6:
|
|
254
254
|
# install-ci is one-time).
|
|
255
255
|
|
|
256
256
|
jobs:
|
|
@@ -467,7 +467,7 @@ jobs:
|
|
|
467
467
|
- name: advance one item in-place (merge ⇒ rebase + CAS land on main)
|
|
468
468
|
# In-place (no --isolated/--remote). \`--merge\` ties the integration mode
|
|
469
469
|
# to THIS (matrix) shape: it sits at the top of the precedence chain, so
|
|
470
|
-
# the workflow mode always wins over the repo's
|
|
470
|
+
# the workflow mode always wins over the repo's \`dorfl.json\` default.
|
|
471
471
|
# Cross-job land safety comes from the engine's CAS-retry loop, not from
|
|
472
472
|
# this workflow's job shape. \`gh\` (merge / PR housekeeping) reads
|
|
473
473
|
# \`GH_TOKEN\` from the env.
|
|
@@ -580,7 +580,7 @@ export function validateAdvanceLifecycleWorkflow(text) {
|
|
|
580
580
|
// The workflow emits NO active gate env line for any of AUTO_BUILD / AUTO_TASK
|
|
581
581
|
// / OBSERVATION_TRIAGE / SURFACE_BLOCKERS: the env layer is the OPTIONAL CI-only
|
|
582
582
|
// override layer, NOT the carrier of defaults. Emitting any of them would FORCE
|
|
583
|
-
// env to win over the repo's own
|
|
583
|
+
// env to win over the repo's own dorfl.json (the precedence is
|
|
584
584
|
// flag > env > per-repo > global > default), silently shadowing per-repo gate
|
|
585
585
|
// config in CI — exactly the bug this task closes. A user who genuinely wants a
|
|
586
586
|
// CI-SPECIFIC override adds the env var themselves (the opt-in CI override the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advance-lifecycle-template.js","sourceRoot":"","sources":["../src/advance-lifecycle-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAGH,OAAO,EAAC,wBAAwB,EAAC,MAAM,sBAAsB,CAAC;AAE9D,6EAA6E;AAC7E,MAAM,CAAC,MAAM,+BAA+B,GAAG,mBAAmB,CAAC;AAEnE,oEAAoE;AACpE,MAAM,CAAC,MAAM,kCAAkC,GAC9C,oJAAoJ,CAAC;AAEtJ,8EAA8E;AAC9E,MAAM,CAAC,MAAM,+BAA+B,GAC3C,iCAAiC,CAAC;AAEnC;;;;;;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D,8DAA8D,CAAC,CAAC;IAEjE,OAAO,EAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAC,CAAC;AAC9C,CAAC"}
|
package/dist/brand.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* - the `DORFL_` env-var prefix (a missed one is read as "unset" — the
|
|
10
10
|
* worst kind of failure: silent);
|
|
11
|
-
* - the
|
|
11
|
+
* - the `dorfl.json` per-repo config filename;
|
|
12
12
|
* - the `~/.dorfl/` workspaces-dir default + the `dorfl` config
|
|
13
13
|
* dir name;
|
|
14
14
|
* - the `.dorfl-job.json` per-job record filename;
|
package/dist/brand.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* - the `DORFL_` env-var prefix (a missed one is read as "unset" — the
|
|
10
10
|
* worst kind of failure: silent);
|
|
11
|
-
* - the
|
|
11
|
+
* - the `dorfl.json` per-repo config filename;
|
|
12
12
|
* - the `~/.dorfl/` workspaces-dir default + the `dorfl` config
|
|
13
13
|
* dir name;
|
|
14
14
|
* - the `.dorfl-job.json` per-job record filename;
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
+
import { type ResyncResult } from './resync-protocol.js';
|
|
3
4
|
import { type InstallSkillsResult } from './install-skills.js';
|
|
5
|
+
/**
|
|
6
|
+
* Human-readable report for the deterministic protocol re-sync half of
|
|
7
|
+
* `dorfl sync`. Groups the docs into changed / unchanged / skipped and names the
|
|
8
|
+
* VERSION file. `dryRun` reframes it as "WOULD" so a preview reads honestly.
|
|
9
|
+
* A SKIPPED doc (unresolvable source) is surfaced LOUDLY — the contract in the
|
|
10
|
+
* target repo is incomplete for that doc.
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatSyncReport(result: ResyncResult, dryRun: boolean): string;
|
|
4
13
|
export declare function buildProgram(): Command;
|
|
5
14
|
/**
|
|
6
15
|
* Human-readable report for `dorfl skills add`. Prints the SOURCE the skills
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,OAAO,EAAS,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,OAAO,EAAS,MAAM,WAAW,CAAC;AAmH1C,OAAO,EAAiB,KAAK,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAuCvE,OAAO,EAAgB,KAAK,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AA2xB5E;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,OAAO,GACb,MAAM,CAoCR;AA6RD,wBAAgB,YAAY,IAAI,OAAO,CAs3GtC;AAaD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE,OAAO,GACZ,MAAM,CAyBR;AA+FD;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQzE"}
|
package/dist/cli.js
CHANGED
|
@@ -46,6 +46,7 @@ import { renderPrompt } from './prompt.js';
|
|
|
46
46
|
import { resolvePromptGuidance } from './config.js';
|
|
47
47
|
import { gc, RETAIN_REASON_TEXT } from './gc.js';
|
|
48
48
|
import { runPrdToSpec, } from './prd-to-spec.js';
|
|
49
|
+
import { resyncProtocol } from './resync-protocol.js';
|
|
49
50
|
import { sweepRemoteMergedBranches } from './reap-branches.js';
|
|
50
51
|
import { sweepOrphanSidecars } from './orphan-sidecar.js';
|
|
51
52
|
import { sweepLedgerDuplicates, formatLedgerSweep } from './ledger-lint.js';
|
|
@@ -123,7 +124,7 @@ function loadGlobalAndOverride(configPath) {
|
|
|
123
124
|
}
|
|
124
125
|
/**
|
|
125
126
|
* Resolve the effective config for a `do --remote <r>` run, layering the target
|
|
126
|
-
* repo's COMMITTED
|
|
127
|
+
* repo's COMMITTED `dorfl.json` (read from `<arbiter>/main` via the hub
|
|
127
128
|
* mirror) into the SAME `flag > env > per-repo > global > default` chain in-place
|
|
128
129
|
* `do` uses. This is the no-checkout analogue of {@link resolveRepoConfig}: there
|
|
129
130
|
* is no working tree, so the bytes come from the arbiter's `main` instead of the
|
|
@@ -138,7 +139,7 @@ function loadGlobalAndOverride(configPath) {
|
|
|
138
139
|
* the arbiter was momentarily offline.
|
|
139
140
|
*
|
|
140
141
|
* The config read uses {@link ensureMirrorMain} (main-only, NO-prune), NOT the
|
|
141
|
-
* all-heads pruning {@link ensureMirror}: `git show main
|
|
142
|
+
* all-heads pruning {@link ensureMirror}: `git show main:dorfl.json` only
|
|
142
143
|
* needs `main`, and the all-heads `+refs/heads/*:refs/heads/*` fetch would let a
|
|
143
144
|
* `work/<slug>` branch CHECKED OUT in some stale job worktree block it (git
|
|
144
145
|
* refuses to fetch into a checked-out branch), throwing the read into its
|
|
@@ -343,7 +344,7 @@ function resolveDefaultArbiterForCwd(cwd, global, flags, override) {
|
|
|
343
344
|
// The SAME per-repo config read in-place `do` uses (`resolveRepoConfig` on the
|
|
344
345
|
// cwd), so `--isolated` resolves the arbiter remote NAME (`defaultArbiter`)
|
|
345
346
|
// through the identical `flag > env > per-repo > global > default` chain. An
|
|
346
|
-
// absent
|
|
347
|
+
// absent `dorfl.json` falls back to the global/default (`origin`).
|
|
347
348
|
return resolveRepoConfig({ repoPath: cwd, global, flags, override }).config
|
|
348
349
|
.defaultArbiter;
|
|
349
350
|
}
|
|
@@ -512,6 +513,60 @@ function printPrdToSpecReport(result) {
|
|
|
512
513
|
function printLeak(leak) {
|
|
513
514
|
console.error(` [${leak.lens}] ${leak.where}: '${leak.token}' — ${leak.why}`);
|
|
514
515
|
}
|
|
516
|
+
/**
|
|
517
|
+
* A minimal interactive yes/no confirmation (default NO). Prompts on stderr
|
|
518
|
+
* (stdout stays reserved for machine/report output) and reads one line from
|
|
519
|
+
* stdin. Callers only reach this on an interactive (TTY) session — a non-TTY
|
|
520
|
+
* path decides WITHOUT prompting (so a scripted run never hangs). Returns true
|
|
521
|
+
* only for an explicit `y`/`yes`.
|
|
522
|
+
*/
|
|
523
|
+
function confirmYesNo(message) {
|
|
524
|
+
return new Promise((resolvePrompt) => {
|
|
525
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
526
|
+
rl.question(`${message} [y/N] `, (answer) => {
|
|
527
|
+
rl.close();
|
|
528
|
+
const a = answer.trim().toLowerCase();
|
|
529
|
+
resolvePrompt(a === 'y' || a === 'yes');
|
|
530
|
+
});
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Human-readable report for the deterministic protocol re-sync half of
|
|
535
|
+
* `dorfl sync`. Groups the docs into changed / unchanged / skipped and names the
|
|
536
|
+
* VERSION file. `dryRun` reframes it as "WOULD" so a preview reads honestly.
|
|
537
|
+
* A SKIPPED doc (unresolvable source) is surfaced LOUDLY — the contract in the
|
|
538
|
+
* target repo is incomplete for that doc.
|
|
539
|
+
*/
|
|
540
|
+
export function formatSyncReport(result, dryRun) {
|
|
541
|
+
const lines = [];
|
|
542
|
+
const changed = result.docs.filter((d) => !d.unchanged && !d.skipped);
|
|
543
|
+
const unchanged = result.docs.filter((d) => d.unchanged);
|
|
544
|
+
const skipped = result.docs.filter((d) => d.skipped);
|
|
545
|
+
const verb = dryRun ? 'WOULD sync' : 'Synced';
|
|
546
|
+
lines.push(dryRun
|
|
547
|
+
? '=== dorfl sync (DRY RUN — nothing written) ==='
|
|
548
|
+
: '=== dorfl sync ===');
|
|
549
|
+
lines.push(`Protocol: ${verb} ${result.docs.length} doc(s) — ` +
|
|
550
|
+
`${changed.length} changed, ${unchanged.length} unchanged, ` +
|
|
551
|
+
`${skipped.length} skipped.`);
|
|
552
|
+
for (const d of changed) {
|
|
553
|
+
lines.push(` ~ ${d.dest}`);
|
|
554
|
+
}
|
|
555
|
+
for (const d of skipped) {
|
|
556
|
+
lines.push(` !! ${d.name}: SOURCE could not be resolved — NOT copied ` +
|
|
557
|
+
'(the contract doc is missing in the package).');
|
|
558
|
+
}
|
|
559
|
+
if (changed.length > 0 || skipped.length === result.docs.length) {
|
|
560
|
+
lines.push(`VERSION: ${dryRun ? 'WOULD bump' : 'bumped'} ${result.versionPath}` +
|
|
561
|
+
(skipped.length === result.docs.length
|
|
562
|
+
? ' (no doc synced — no bump)'
|
|
563
|
+
: '.'));
|
|
564
|
+
}
|
|
565
|
+
else {
|
|
566
|
+
lines.push(`VERSION: unchanged (${result.versionPath} — already current).`);
|
|
567
|
+
}
|
|
568
|
+
return lines.join('\n');
|
|
569
|
+
}
|
|
515
570
|
/**
|
|
516
571
|
* Resolve a task-only command's slug argument through the §3a namespace guard
|
|
517
572
|
* (`resolveTaskOnlyArg`): accept bare (= task) + `task:` (explicit alias),
|
|
@@ -1142,7 +1197,7 @@ export function buildProgram() {
|
|
|
1142
1197
|
const slug = resolveTaskOnlySlug(rawSlug);
|
|
1143
1198
|
// Resolve the `promptGuidance` NUDGE namespace through the SAME chain the
|
|
1144
1199
|
// gate family uses (env > per-repo > global > default), so e.g. a
|
|
1145
|
-
// `promptGuidance.testFirst:true` in
|
|
1200
|
+
// `promptGuidance.testFirst:true` in `dorfl.json` strengthens the
|
|
1146
1201
|
// wrapper line for `dorfl prompt` exactly as it would in `do`/`run`.
|
|
1147
1202
|
const cwd = process.cwd();
|
|
1148
1203
|
const global = loadConfig();
|
|
@@ -1233,7 +1288,7 @@ export function buildProgram() {
|
|
|
1233
1288
|
process.exit(recovered.exitCode);
|
|
1234
1289
|
}
|
|
1235
1290
|
// Resolve the integration mode at completion time, highest first:
|
|
1236
|
-
// --merge/--propose flag > per-repo
|
|
1291
|
+
// --merge/--propose flag > per-repo dorfl.json > global > default.
|
|
1237
1292
|
// The flag sits at the TOP of the same chain the autonomous runner uses
|
|
1238
1293
|
// (per-repo > global > default), so human and autonomous paths agree.
|
|
1239
1294
|
const flagMode = integrationFromFlags(flags);
|
|
@@ -1381,7 +1436,7 @@ export function buildProgram() {
|
|
|
1381
1436
|
const cwd = process.cwd();
|
|
1382
1437
|
const { global, override } = loadGlobalAndOverride(flags.config);
|
|
1383
1438
|
// Resolve the integration mode at integrate-time, highest first:
|
|
1384
|
-
// --merge/--propose flag > per-repo
|
|
1439
|
+
// --merge/--propose flag > per-repo dorfl.json > global > default.
|
|
1385
1440
|
// (Same chain `complete` uses — `do` is the autonomous twin.)
|
|
1386
1441
|
let flagMode;
|
|
1387
1442
|
try {
|
|
@@ -1403,7 +1458,7 @@ export function buildProgram() {
|
|
|
1403
1458
|
// ORTHOGONAL: `--isolated` + `--remote` is REDUNDANT (a foreign `--remote` is
|
|
1404
1459
|
// already isolated), so we accept it and `--remote` WINS (see `## Decisions`).
|
|
1405
1460
|
//
|
|
1406
|
-
// In BOTH cases the repo's COMMITTED
|
|
1461
|
+
// In BOTH cases the repo's COMMITTED `dorfl.json` is reachable on
|
|
1407
1462
|
// `<arbiter>/main` (the mirror), so we layer it — `flag > env > per-repo >
|
|
1408
1463
|
// global > default` parity with in-place `do` (task
|
|
1409
1464
|
// `remote-do-reads-per-repo-config-from-arbiter-main`). Only the whitelisted
|
|
@@ -1508,7 +1563,7 @@ export function buildProgram() {
|
|
|
1508
1563
|
// mirror fetch runs under). These are host-only by definition (rejected
|
|
1509
1564
|
// per-repo), so reading them from global+flags first is correct and stable.
|
|
1510
1565
|
const bootstrap = resolveGlobalConfig(global, remoteFlags);
|
|
1511
|
-
// Source the committed
|
|
1566
|
+
// Source the committed `dorfl.json` from `<arbiter>/main` via the
|
|
1512
1567
|
// hub mirror, then layer ONLY its whitelisted keys through the EXISTING
|
|
1513
1568
|
// per-repo machinery. The read refreshes ONLY `main` (no-prune), so a
|
|
1514
1569
|
// `work/<slug>` branch checked out in a stale worktree can never block it,
|
|
@@ -1563,7 +1618,7 @@ export function buildProgram() {
|
|
|
1563
1618
|
// Single-job build path: gate the REBASED tip (the default) unconditionally.
|
|
1564
1619
|
freshWorktreeGate: remoteConfig.freshWorktreeGate,
|
|
1565
1620
|
// Cross-job merge-serialiser CAS-retry cap (resolved through the per-repo
|
|
1566
|
-
// chain on the arbiter-side
|
|
1621
|
+
// chain on the arbiter-side `dorfl.json` too) — spec
|
|
1567
1622
|
// `land-time-reverify-and-parallel-merge-ceiling` Story 5.
|
|
1568
1623
|
mergeRetries: remoteConfig.mergeRetries,
|
|
1569
1624
|
noPR: remoteConfig.noPR,
|
|
@@ -1894,7 +1949,7 @@ export function buildProgram() {
|
|
|
1894
1949
|
const cwd = process.cwd();
|
|
1895
1950
|
const { global, override } = loadGlobalAndOverride(flags.config);
|
|
1896
1951
|
// Resolve the integration mode this invocation asks for, highest first:
|
|
1897
|
-
// --merge/--propose flag > per-repo
|
|
1952
|
+
// --merge/--propose flag > per-repo dorfl.json > global > default.
|
|
1898
1953
|
// The SAME chain `do`/`complete` use (via `integrationFromFlags`), so the
|
|
1899
1954
|
// human, the autonomous runner, and the CI workflow all resolve the SAME
|
|
1900
1955
|
// order. This is what ties the CI dispatch `integrationMode` to the actual
|
|
@@ -1948,7 +2003,7 @@ export function buildProgram() {
|
|
|
1948
2003
|
`remote), or use --remote <url> to target another repo.`);
|
|
1949
2004
|
process.exit(1);
|
|
1950
2005
|
}
|
|
1951
|
-
// Source the arbiter's COMMITTED
|
|
2006
|
+
// Source the arbiter's COMMITTED `dorfl.json` from `<arbiter>/main`
|
|
1952
2007
|
// via the hub mirror + layer ONLY its whitelisted keys — the SAME
|
|
1953
2008
|
// resolution `do --isolated` uses, so the gate family (autoBuild/autoTask/
|
|
1954
2009
|
// observationTriage/surfaceBlockers) + selectionOrder + integration resolve
|
|
@@ -2460,6 +2515,59 @@ export function buildProgram() {
|
|
|
2460
2515
|
}
|
|
2461
2516
|
console.log(`Summary: ${result.reaped.length} reaped, ${result.retained.length} retained.`);
|
|
2462
2517
|
});
|
|
2518
|
+
// `dorfl sync`: bring an already-onboarded repo up to the CURRENT protocol.
|
|
2519
|
+
// Always re-syncs `work/protocol/*` + bumps VERSION (the deterministic slice of
|
|
2520
|
+
// `setup`, shared with `prd-to-spec` via `resync-protocol.ts`). `--add-skills`
|
|
2521
|
+
// ADDITIONALLY (re-)installs the packaged skills into the operator's harness
|
|
2522
|
+
// dir(s), NON-INTERACTIVELY (the flag IS the confirmation); without it an
|
|
2523
|
+
// interactive session PROMPTS once and a non-TTY session skips skills.
|
|
2524
|
+
program
|
|
2525
|
+
.command('sync')
|
|
2526
|
+
.helpGroup(HEADLINE_GROUP)
|
|
2527
|
+
.description("Bring THIS repo up to the current dorfl protocol: re-sync work/protocol/* from the package's canonical contract docs and bump work/protocol/VERSION (idempotent — a no-op when already current). This is how a repo that adopted an older protocol picks up the latest. Optionally ALSO (re-)installs the packaged dorfl skills into your own harness: pass --add-skills to do it non-interactively (the flag bypasses the ask), otherwise an interactive run prompts once (a non-TTY run skips skills). Runs IN-PLACE (no git commit/push — the human commits the result).")
|
|
2528
|
+
.option('--repo <dir>', 'the repo working-tree root to sync (default: cwd)')
|
|
2529
|
+
.option('--dry-run', 'REPORT what the protocol re-sync WOULD change, touching nothing (no writes; skills are never installed under --dry-run)')
|
|
2530
|
+
.option('--add-skills', 'ALSO (re-)install the packaged dorfl skills into your own harness dir(s), non-interactively. This flag IS the confirmation — it bypasses the interactive ask.')
|
|
2531
|
+
.option('--local', 'with skills install: scope to <cwd>/.agents/skills/ instead of the global ~/.agents/skills/ default')
|
|
2532
|
+
.option('--json', 'output the raw protocol re-sync result as JSON')
|
|
2533
|
+
.action(async (flags) => {
|
|
2534
|
+
const repoPath = flags.repo ?? process.cwd();
|
|
2535
|
+
const dryRun = flags.dryRun === true;
|
|
2536
|
+
// 1. The deterministic protocol re-sync (always runs).
|
|
2537
|
+
const resync = resyncProtocol(repoPath, {
|
|
2538
|
+
dryRun,
|
|
2539
|
+
sourceCommit: 'dorfl sync',
|
|
2540
|
+
});
|
|
2541
|
+
if (flags.json) {
|
|
2542
|
+
console.log(JSON.stringify(resync, null, 2));
|
|
2543
|
+
}
|
|
2544
|
+
else {
|
|
2545
|
+
console.log(formatSyncReport(resync, dryRun));
|
|
2546
|
+
}
|
|
2547
|
+
// A doc whose source could not be resolved is a broken package — exit
|
|
2548
|
+
// non-zero so a scripted `sync` notices the incomplete contract.
|
|
2549
|
+
const anySkipped = resync.docs.some((d) => d.skipped);
|
|
2550
|
+
// 2. The OPTIONAL skills install. Never under --dry-run (a preview writes
|
|
2551
|
+
// nothing). `--add-skills` authorises it directly (bypasses the ask);
|
|
2552
|
+
// otherwise an interactive TTY prompts once, and a non-TTY skips.
|
|
2553
|
+
if (!dryRun) {
|
|
2554
|
+
let doSkills = flags.addSkills === true;
|
|
2555
|
+
if (!doSkills && process.stdin.isTTY) {
|
|
2556
|
+
const scope = flags.local === true ? 'project-local' : 'global';
|
|
2557
|
+
doSkills = await confirmYesNo(`Also (re-)install the packaged dorfl skills into your ${scope} harness dir(s)?`);
|
|
2558
|
+
}
|
|
2559
|
+
if (doSkills) {
|
|
2560
|
+
const result = installSkills({ global: flags.local !== true });
|
|
2561
|
+
console.log(formatSkillsAddReport(result, flags.local === true));
|
|
2562
|
+
}
|
|
2563
|
+
else if (flags.addSkills !== true && !process.stdin.isTTY) {
|
|
2564
|
+
console.error('>> Skills not installed (non-interactive run; pass --add-skills to install them).');
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
if (anySkipped) {
|
|
2568
|
+
process.exit(1);
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
2463
2571
|
program
|
|
2464
2572
|
.command('prd-to-spec')
|
|
2465
2573
|
.helpGroup(ADVANCED_GROUP)
|