@warpgogol/forge 9.4.0 → 9.4.1
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/CHANGELOG.md +15 -0
- package/README.md +4 -2
- package/README.uk.md +10 -8
- package/dist/os/flow/dirty-classify.d.ts +4 -1
- package/dist/os/flow/dirty-classify.d.ts.map +1 -1
- package/dist/os/flow/dirty-classify.js +2 -0
- package/dist/os/flow/dirty-classify.js.map +1 -1
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +27 -2
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +22 -8
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts +6 -0
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +118 -40
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-peers.d.ts +24 -0
- package/dist/os/flow/handlers/flow-peers.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-peers.js +99 -0
- package/dist/os/flow/handlers/flow-peers.js.map +1 -0
- package/dist/os/flow/index.d.ts +2 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +4 -1
- package/dist/os/flow/index.js.map +1 -1
- package/dist/os/flow/ops-registry.d.ts +33 -0
- package/dist/os/flow/ops-registry.d.ts.map +1 -0
- package/dist/os/flow/ops-registry.js +177 -0
- package/dist/os/flow/ops-registry.js.map +1 -0
- package/dist/os/flow/preflight.d.ts +46 -3
- package/dist/os/flow/preflight.d.ts.map +1 -1
- package/dist/os/flow/preflight.js +196 -44
- package/dist/os/flow/preflight.js.map +1 -1
- package/dist/os/flow/standalone-invoke.d.ts +11 -0
- package/dist/os/flow/standalone-invoke.d.ts.map +1 -0
- package/dist/os/flow/standalone-invoke.js +75 -0
- package/dist/os/flow/standalone-invoke.js.map +1 -0
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +12 -8
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/importer-block.d.ts +19 -0
- package/dist/os/mission/importer-block.d.ts.map +1 -0
- package/dist/os/mission/importer-block.js +124 -0
- package/dist/os/mission/importer-block.js.map +1 -0
- package/dist/os/mission/lockfile.d.ts +17 -0
- package/dist/os/mission/lockfile.d.ts.map +1 -1
- package/dist/os/mission/lockfile.js +38 -0
- package/dist/os/mission/lockfile.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +25 -3
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/types.d.ts +9 -2
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +2 -2
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-collect.js +11 -5
- package/dist/os/system/handlers/system-task-collect.js.map +1 -1
- package/dist/src/onboarding/prettierignore.d.ts.map +1 -1
- package/dist/src/onboarding/prettierignore.js +2 -0
- package/dist/src/onboarding/prettierignore.js.map +1 -1
- package/os/flow/dirty-classify.ts +8 -0
- package/os/flow/flow.module.ts +29 -2
- package/os/flow/handlers/flow-cut.ts +28 -11
- package/os/flow/handlers/flow-integrate.ts +177 -50
- package/os/flow/handlers/flow-peers.ts +142 -0
- package/os/flow/index.ts +5 -1
- package/os/flow/ops-registry.ts +194 -0
- package/os/flow/preflight.ts +262 -51
- package/os/flow/standalone-invoke.ts +85 -0
- package/os/flow/tests/dirty-classify.test.ts +139 -4
- package/os/flow/tests/flow-cut.test.ts +21 -0
- package/os/flow/tests/flow-integrate.preflight.test.ts +8 -4
- package/os/flow/tests/flow-integrate.test.ts +366 -16
- package/os/flow/tests/ops-registry.test.ts +136 -0
- package/os/mission/handlers/archive.ts +22 -14
- package/os/mission/importer-block.ts +119 -0
- package/os/mission/lockfile.ts +41 -0
- package/os/rfc/handlers/list-create.test.ts +44 -0
- package/os/rfc/handlers/list-create.ts +30 -3
- package/os/rfc/types.ts +5 -2
- package/os/system/handlers/system-task-collect.ts +11 -5
- package/os/system/tests/system-task-collect.test.ts +16 -0
- package/package.json +1 -1
- package/skills/fo/fo-session-retro/SKILL.md +9 -3
- package/src/onboarding/prettierignore.ts +2 -0
- package/src/tests/prettierignore-manage.test.ts +11 -0
package/dist/os/flow/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { primaryWorktree, resolveStateRoots, worktreeList };
|
|
|
5
5
|
export { FORGE_STATE_FILES } from "./git.ts";
|
|
6
6
|
export type { StateRoots };
|
|
7
7
|
export type { FlowWorktree } from "./git.ts";
|
|
8
|
+
export { classifyBranch } from "./branch-name.ts";
|
|
9
|
+
export type { BranchClass } from "./branch-name.ts";
|
|
8
10
|
export interface RepositoryLineVersion {
|
|
9
11
|
/** "6.451.0+12.ab12cd34e" for a tagged line, "6.451.0" from the version file otherwise. */
|
|
10
12
|
version: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../os/flow/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../os/flow/index.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAqB,YAAY,EAAE,MAAM,UAAU,CAAC;AAK3D,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,YAAY,EAAE,UAAU,EAAE,CAAC;AAC3B,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC,2FAA2F;IAC3F,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,GAAG,cAAc,CAAC;IACvC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,qBAAqB,CAAC,CAuBhC;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAOvF"}
|
package/dist/os/flow/index.js
CHANGED
|
@@ -15,11 +15,13 @@ reachable, else the version-file value.</purpose>
|
|
|
15
15
|
<item>Untagged is not an error — it resolves to the version-file value; only a missing or unparsable version file throws.</item>
|
|
16
16
|
</KEY_DECISIONS>
|
|
17
17
|
<CHANGE_SUMMARY>
|
|
18
|
-
<item>RFC-1493: step 1 — forge public release-line version reader</item>
|
|
19
18
|
<item>RFC-1494: step 1 — isFlowAdopted public export</item>
|
|
20
19
|
<item>RFC-1495: step 1 - forge state roots</item>
|
|
21
20
|
<item>RFC-1495: steps 2-3 - workshop paths resolver and call-site migration</item>
|
|
22
21
|
<item>RFC-1519: add advisory gate-verdict store for scoped pass reuse across reruns and the commit-integrate boundary</item>
|
|
22
|
+
<item>RFC-1549: route generated onboarding-status commits through session flow on fixed branches
|
|
23
|
+
|
|
24
|
+
commitWerkstattSideEffects skips git add+commit when classifyBranch() yields non-flow (protected/nonconforming), reports written outputPaths; status-hook and deploy/leitstand results propagate onboardingStatus metadata; leitstand.promote surfaces an optional session-worktree integration nextStep. Flow-branch commit behavior unchanged; mission-open fixture rebased to conforming auto/task-YYMMDD-NN branch. AC-1..AC-3 checked.</item>
|
|
23
25
|
<history>RFC-1493</history>
|
|
24
26
|
</CHANGE_SUMMARY>
|
|
25
27
|
*/
|
|
@@ -34,6 +36,7 @@ import { primaryWorktree, resolveStateRoots, } from "./worktree-path.js";
|
|
|
34
36
|
// @warpgogol/*). The engine's workshop-paths builds the names on top.
|
|
35
37
|
export { primaryWorktree, resolveStateRoots, worktreeList };
|
|
36
38
|
export { FORGE_STATE_FILES } from "./git.js";
|
|
39
|
+
export { classifyBranch } from "./branch-name.js";
|
|
37
40
|
/**
|
|
38
41
|
* Resolve the repository release line's version: the derived
|
|
39
42
|
* `X.Y.Z+N.<head9>[.dirty]` anchored to the last reachable annotated `v*`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../os/flow/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../os/flow/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BE;AAGF,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,eAAe,EACf,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAE5B,2EAA2E;AAC3E,qEAAqE;AACrE,sEAAsE;AACtE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;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AAS,GAAG,MAAM,cAAc,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACrD,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IAC1E,IAAI,CAAC,CAAC,MAAM,YAAY,CAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACjE,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,WAAW,cAAc,EAAE,CAAC,CAAC,CAAC;IACjF,IAAI,SAAS,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { WorkspaceIO } from "../../src/types.ts";
|
|
2
|
+
export declare const OP_CLAIM_SCHEMA = "forge/op-claim@1";
|
|
3
|
+
/** Expected heartbeat write cadence — a claim goes stale at 5× this age. */
|
|
4
|
+
export declare const HEARTBEAT_CADENCE_MS = 30000;
|
|
5
|
+
export interface OpClaim {
|
|
6
|
+
schema: typeof OP_CLAIM_SCHEMA;
|
|
7
|
+
opId: string;
|
|
8
|
+
command: string;
|
|
9
|
+
pid: number;
|
|
10
|
+
host: string;
|
|
11
|
+
bootId?: string;
|
|
12
|
+
startedAt: string;
|
|
13
|
+
heartbeatAt: string;
|
|
14
|
+
workspaceRoot: string;
|
|
15
|
+
/** Exact paths or directory prefixes the op legitimately dirties. */
|
|
16
|
+
paths: string[];
|
|
17
|
+
}
|
|
18
|
+
/** Liveness (AC-2): pid alive on this host+bootId AND heartbeat ≤5×cadence. */
|
|
19
|
+
export declare function isClaimLive(claim: OpClaim, now?: number): boolean;
|
|
20
|
+
/** True when `path` equals or sits under a declared claim path/prefix. */
|
|
21
|
+
export declare function claimCoversPath(claim: OpClaim, path: string): boolean;
|
|
22
|
+
/** Write a claim before the op's first shared-checkout mutation — best-effort. */
|
|
23
|
+
export declare function claimOp(repo: string, io: WorkspaceIO, claim: Omit<OpClaim, "schema" | "pid" | "host" | "bootId" | "startedAt" | "heartbeatAt"> & {
|
|
24
|
+
startedAt?: string;
|
|
25
|
+
}): Promise<boolean>;
|
|
26
|
+
/** Refresh a live claim's heartbeat — best-effort, same path. */
|
|
27
|
+
export declare function heartbeatOp(repo: string, io: WorkspaceIO, opId: string): Promise<void>;
|
|
28
|
+
/** Best-effort removal — liveness, not deletion, is authoritative. */
|
|
29
|
+
export declare function releaseOp(repo: string, io: WorkspaceIO, opId: string): Promise<void>;
|
|
30
|
+
/** Read-only variant for surfaces that must not mutate (flow.peers). */
|
|
31
|
+
export declare function liveClaimsReadOnly(repo: string, io: WorkspaceIO): Promise<OpClaim[]>;
|
|
32
|
+
export declare function liveClaims(repo: string, io: WorkspaceIO): Promise<OpClaim[]>;
|
|
33
|
+
//# sourceMappingURL=ops-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops-registry.d.ts","sourceRoot":"","sources":["../../../os/flow/ops-registry.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,4EAA4E;AAC5E,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,OAAO,eAAe,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAeD,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,GAAE,MAAmB,GAAG,OAAO,CAK7E;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKrE;AAED,kFAAkF;AAClF,wBAAsB,OAAO,CAC3B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG;IACzF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACA,OAAO,CAAC,OAAO,CAAC,CAoBlB;AAED,iEAAiE;AACjE,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAY5F;AAED,sEAAsE;AACtE,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ1F;AA+CD,wEAAwE;AACxE,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAE1F;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAUlF"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Shared operation-claims registry (RFC-1543) — long-running ops that
|
|
4
|
+
write git-visible state in a checkout they do not own journal a
|
|
5
|
+
`forge/op-claim@1` record under the shared git dir before mutating, so
|
|
6
|
+
`classifyDirt` can attribute otherwise-foreign dirt to a live holder instead
|
|
7
|
+
of refusing blind. Liveness (pid alive on this host+bootId, heartbeat
|
|
8
|
+
≤5×cadence), not deletion, is authoritative — a crashed op's record is
|
|
9
|
+
reclaimed by the next reader, never trusted.</purpose>
|
|
10
|
+
<non-goals>
|
|
11
|
+
<item>No cross-host coordination — claims are machine-local, same trust model as integrate.lock.</item>
|
|
12
|
+
<item>No mutation authority — readers may sweep dead records; they never edit claims or block on them directly.</item>
|
|
13
|
+
</non-goals>
|
|
14
|
+
</MODULE_CONTRACT>
|
|
15
|
+
<KEY_DECISIONS>
|
|
16
|
+
<item>Claims live at <git-common-dir>/forge/ops/<opId>.yaml — worktrees share one git dir, so a claim written from a session worktree is visible to the primary by construction.</item>
|
|
17
|
+
<item>Claim-write failure degrades to unclaimed behavior (fail-safe): the op proceeds and classification keeps the old refusal semantics — a registry outage must never become a write blocker.</item>
|
|
18
|
+
</KEY_DECISIONS>
|
|
19
|
+
<CHANGE_SUMMARY>
|
|
20
|
+
<item>RFC-1543: op-claim registry — claim/release/liveClaims, pid+bootId+heartbeat liveness, lazy dead-record sweep</item>
|
|
21
|
+
<item>RFC-1543: attribute shared-checkout dirt to live ops and expose peers (RFC-1543)</item>
|
|
22
|
+
</CHANGE_SUMMARY>
|
|
23
|
+
*/
|
|
24
|
+
import { hostname } from "node:os";
|
|
25
|
+
import { join } from "node:path";
|
|
26
|
+
import { parse as yamlParse, stringify as yamlStringify } from "yaml";
|
|
27
|
+
import { currentBootId, holderIsDead } from "../core/lock-holder.js";
|
|
28
|
+
import { git } from "./git.js";
|
|
29
|
+
export const OP_CLAIM_SCHEMA = "forge/op-claim@1";
|
|
30
|
+
/** Expected heartbeat write cadence — a claim goes stale at 5× this age. */
|
|
31
|
+
export const HEARTBEAT_CADENCE_MS = 30_000;
|
|
32
|
+
/** `<git-common-dir>/forge/ops` — shared across linked worktrees. */
|
|
33
|
+
async function opsDir(repo, io) {
|
|
34
|
+
let r;
|
|
35
|
+
try {
|
|
36
|
+
r = await git(repo, io, ["rev-parse", "--git-common-dir"]);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (r.exitCode !== 0)
|
|
42
|
+
return null;
|
|
43
|
+
const dir = r.stdout.trim();
|
|
44
|
+
return join(dir.startsWith("/") ? dir : join(repo, dir), "forge", "ops");
|
|
45
|
+
}
|
|
46
|
+
/** Liveness (AC-2): pid alive on this host+bootId AND heartbeat ≤5×cadence. */
|
|
47
|
+
export function isClaimLive(claim, now = Date.now()) {
|
|
48
|
+
if (holderIsDead(claim, currentBootId()))
|
|
49
|
+
return false;
|
|
50
|
+
const beat = Date.parse(claim.heartbeatAt);
|
|
51
|
+
if (!Number.isFinite(beat) || now - beat > 5 * HEARTBEAT_CADENCE_MS)
|
|
52
|
+
return false;
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
/** True when `path` equals or sits under a declared claim path/prefix. */
|
|
56
|
+
export function claimCoversPath(claim, path) {
|
|
57
|
+
return claim.paths.some((p) => {
|
|
58
|
+
const prefix = p.endsWith("/") ? p : `${p}/`;
|
|
59
|
+
return path === p || path.startsWith(prefix);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** Write a claim before the op's first shared-checkout mutation — best-effort. */
|
|
63
|
+
export async function claimOp(repo, io, claim) {
|
|
64
|
+
const dir = await opsDir(repo, io);
|
|
65
|
+
if (dir === null)
|
|
66
|
+
return false;
|
|
67
|
+
const now = new Date().toISOString();
|
|
68
|
+
const record = {
|
|
69
|
+
schema: OP_CLAIM_SCHEMA,
|
|
70
|
+
pid: process.pid,
|
|
71
|
+
host: hostname(),
|
|
72
|
+
bootId: currentBootId(),
|
|
73
|
+
heartbeatAt: now,
|
|
74
|
+
startedAt: claim.startedAt ?? now,
|
|
75
|
+
...claim,
|
|
76
|
+
};
|
|
77
|
+
try {
|
|
78
|
+
await io.mkdir(dir);
|
|
79
|
+
await io.writeFile(join(dir, `${record.opId}.yaml`), yamlStringify(record));
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** Refresh a live claim's heartbeat — best-effort, same path. */
|
|
87
|
+
export async function heartbeatOp(repo, io, opId) {
|
|
88
|
+
const dir = await opsDir(repo, io);
|
|
89
|
+
if (dir === null)
|
|
90
|
+
return;
|
|
91
|
+
const file = join(dir, `${opId}.yaml`);
|
|
92
|
+
try {
|
|
93
|
+
const parsed = yamlParse(await io.readFile(file));
|
|
94
|
+
if (!parsed || parsed.schema !== OP_CLAIM_SCHEMA)
|
|
95
|
+
return;
|
|
96
|
+
parsed.heartbeatAt = new Date().toISOString();
|
|
97
|
+
await io.writeFile(file, yamlStringify(parsed));
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
/* best-effort */
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** Best-effort removal — liveness, not deletion, is authoritative. */
|
|
104
|
+
export async function releaseOp(repo, io, opId) {
|
|
105
|
+
const dir = await opsDir(repo, io);
|
|
106
|
+
if (dir === null)
|
|
107
|
+
return;
|
|
108
|
+
try {
|
|
109
|
+
await io.rm(join(dir, `${opId}.yaml`));
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
/* already gone */
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function parseClaim(raw) {
|
|
116
|
+
let parsed;
|
|
117
|
+
try {
|
|
118
|
+
parsed = yamlParse(raw);
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
if (typeof parsed !== "object" || parsed === null)
|
|
124
|
+
return null;
|
|
125
|
+
const c = parsed;
|
|
126
|
+
if (c.schema !== OP_CLAIM_SCHEMA ||
|
|
127
|
+
typeof c.opId !== "string" ||
|
|
128
|
+
typeof c.command !== "string" ||
|
|
129
|
+
typeof c.pid !== "number" ||
|
|
130
|
+
typeof c.host !== "string" ||
|
|
131
|
+
typeof c.startedAt !== "string" ||
|
|
132
|
+
typeof c.heartbeatAt !== "string" ||
|
|
133
|
+
typeof c.workspaceRoot !== "string" ||
|
|
134
|
+
!Array.isArray(c.paths)) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
return c;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Live claims for `repo`, sweeping dead/stale records lazily as a side
|
|
141
|
+
* effect. Malformed files sweep too — a record we cannot read cannot be
|
|
142
|
+
* liveness-checked and must never grant tolerance.
|
|
143
|
+
*/
|
|
144
|
+
async function readClaims(repo, io) {
|
|
145
|
+
const dir = await opsDir(repo, io);
|
|
146
|
+
if (dir === null || !(await io.exists(dir)))
|
|
147
|
+
return { live: [], dead: [] };
|
|
148
|
+
const files = (await io.glob("*.yaml", { cwd: dir })).filter((f) => !f.endsWith("/"));
|
|
149
|
+
const live = [];
|
|
150
|
+
const dead = [];
|
|
151
|
+
for (const f of files) {
|
|
152
|
+
const abs = join(dir, f);
|
|
153
|
+
const claim = parseClaim(await io.readFile(abs));
|
|
154
|
+
if (claim !== null && isClaimLive(claim))
|
|
155
|
+
live.push(claim);
|
|
156
|
+
else
|
|
157
|
+
dead.push(abs);
|
|
158
|
+
}
|
|
159
|
+
return { live, dead };
|
|
160
|
+
}
|
|
161
|
+
/** Read-only variant for surfaces that must not mutate (flow.peers). */
|
|
162
|
+
export async function liveClaimsReadOnly(repo, io) {
|
|
163
|
+
return (await readClaims(repo, io)).live;
|
|
164
|
+
}
|
|
165
|
+
export async function liveClaims(repo, io) {
|
|
166
|
+
const { live, dead } = await readClaims(repo, io);
|
|
167
|
+
for (const abs of dead) {
|
|
168
|
+
try {
|
|
169
|
+
await io.rm(abs);
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
/* sweep is best-effort */
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return live;
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=ops-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops-registry.js","sourceRoot":"","sources":["../../../os/flow/ops-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;EAsBE;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAClD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAgB3C,qEAAqE;AACrE,KAAK,UAAU,MAAM,CAAC,IAAY,EAAE,EAAe;IACjD,IAAI,CAAC,CAAC;IACN,IAAI,CAAC;QACH,CAAC,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAClC,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC3E,C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AE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;QAAC,MAAM,CAAC;YACP,0BAA0B;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { CommandRegistry, ForgeFlagValue, ForgeInvokeCommand, ForgeRegisteredCommandInfo, WorkspaceIO } from "../../src/types.ts";
|
|
2
2
|
import { type ClassifiedDirtyEntry, type DirtyClass } from "./dirty-classify.ts";
|
|
3
3
|
import { currentBranch, git, statusTracked } from "./git.ts";
|
|
4
|
+
import { type OpClaim } from "./ops-registry.ts";
|
|
4
5
|
export type LockfileClassification = "importer-prune-only" | "other";
|
|
5
6
|
/**
|
|
6
7
|
* Strict match for the pnpm-prune shape: ONLY removed lines, every one either
|
|
7
8
|
* a `missions/<id>/workpiece:` importer key or a deeper-indented member of
|
|
8
|
-
* such a key's block.
|
|
9
|
-
*
|
|
9
|
+
* such a key's block. Returns the sorted pruned mission ids on match, null
|
|
10
|
+
* otherwise — any added line, any other removed line, or a diff with no
|
|
11
|
+
* removals is ambiguous and stays an ordinary refusal.
|
|
10
12
|
*/
|
|
13
|
+
export declare function classifyLockfilePruneIds(diffText: string): string[] | null;
|
|
11
14
|
export declare function classifyLockfileDiff(diffText: string): LockfileClassification;
|
|
12
15
|
/**
|
|
13
16
|
* Mirror of the prune shape for materialization (RFC-1537): ONLY added lines,
|
|
@@ -20,11 +23,43 @@ export type { DirtyClass } from "./dirty-classify.ts";
|
|
|
20
23
|
export interface ToleratedEntry {
|
|
21
24
|
path: string;
|
|
22
25
|
class: DirtyClass;
|
|
26
|
+
/** RFC-1544: pruned mission ids for the lockfile importer classes. */
|
|
27
|
+
missionIds?: string[];
|
|
23
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* RFC-1544: referent state for one pruned `missions/<id>/workpiece` importer
|
|
31
|
+
* — where the directory still exists and whether its mission is open. The
|
|
32
|
+
* classifier stays pure: referents are injected by the caller.
|
|
33
|
+
*/
|
|
34
|
+
export interface ImporterReferent {
|
|
35
|
+
missionId: string;
|
|
36
|
+
/** `missions/<id>/workpiece` exists in the checkout being classified. */
|
|
37
|
+
existsHere: boolean;
|
|
38
|
+
/** Other registered worktrees where the directory exists. */
|
|
39
|
+
existsInCheckout: string[];
|
|
40
|
+
/** An open `missions/<id>/mission.yaml` exists in any registered checkout. */
|
|
41
|
+
missionOpen: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Default referent resolver — `git worktree list` for the checkout set and
|
|
45
|
+
* `openMissionsIn` per checkout for mission state (the same enumeration
|
|
46
|
+
* `flow.status` performs; never cwd-relative guesses).
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveImporterReferents(repo: string, io: WorkspaceIO, missionIds: string[]): Promise<ImporterReferent[]>;
|
|
24
49
|
export interface DirtVerdict {
|
|
25
50
|
tolerated: ToleratedEntry[];
|
|
26
51
|
/** Porcelain lines that match no declared regenerable shape — still refuse. */
|
|
27
52
|
unattributed: string[];
|
|
53
|
+
/**
|
|
54
|
+
* RFC-1543: unattributed paths covered by a LIVE op-claim — class
|
|
55
|
+
* `in-flight-foreign`. They never block silently: the caller either waits
|
|
56
|
+
* for the holder or refuses FLOW-INT-03 naming it. Resolved only for the
|
|
57
|
+
* primary checkout — worktrees are single-owner.
|
|
58
|
+
*/
|
|
59
|
+
foreignInFlight: {
|
|
60
|
+
path: string;
|
|
61
|
+
holder: OpClaim;
|
|
62
|
+
}[];
|
|
28
63
|
}
|
|
29
64
|
/**
|
|
30
65
|
* Partition porcelain lines into declared regenerable classes (tolerated —
|
|
@@ -34,7 +69,7 @@ export interface DirtVerdict {
|
|
|
34
69
|
*/
|
|
35
70
|
export declare function classifyDirt(repo: string, io: WorkspaceIO, entries: string[], deps?: {
|
|
36
71
|
runGit: typeof git;
|
|
37
|
-
}): Promise<DirtVerdict>;
|
|
72
|
+
}, claims?: OpClaim[], resolveReferents?: (missionIds: string[]) => Promise<ImporterReferent[]>): Promise<DirtVerdict>;
|
|
38
73
|
/**
|
|
39
74
|
* RFC-1531 AC-6: classify EVERY dirty entry — tolerated-family classes come
|
|
40
75
|
* from the diff-aware classifyDirt; the remaining entries get their
|
|
@@ -81,6 +116,12 @@ export declare function runIntegratePreflight(opts: {
|
|
|
81
116
|
toleratedState: string[];
|
|
82
117
|
};
|
|
83
118
|
invoke?: ForgeInvokeCommand;
|
|
119
|
+
/**
|
|
120
|
+
* RFC-1543 AC-4: seconds to wait for live foreign claim-holders before
|
|
121
|
+
* FLOW-INT-03 refuses — default 600, 0 restores fail-fast.
|
|
122
|
+
*/
|
|
123
|
+
waitForeignSeconds?: number;
|
|
124
|
+
onProgress?: (line: string) => void;
|
|
84
125
|
commandRegistry?: CommandRegistry;
|
|
85
126
|
/** Test seam — overrides the live inventory union (registry + command manifest). */
|
|
86
127
|
commands?: ForgeRegisteredCommandInfo[];
|
|
@@ -100,6 +141,8 @@ export interface RebaseConflictVerdict {
|
|
|
100
141
|
/** Non-generated paths, or generated paths with no owner → FLOW-INT-02. */
|
|
101
142
|
nonGenerated: string[];
|
|
102
143
|
}
|
|
144
|
+
/** `.generated.` basenames whose owner command is fixed by convention. */
|
|
145
|
+
export declare const GENERATED_BASENAME_OWNERS: Record<string, string>;
|
|
103
146
|
/**
|
|
104
147
|
* Classify a rebase conflict set (RFC-1538): every path must classify
|
|
105
148
|
* generated via isGeneratedPathName/isGeneratedContent (stage-2/3 content),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../../os/flow/preflight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../../os/flow/preflight.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAGL,KAA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