@vibe-commit/capture 0.1.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/LICENSE +21 -0
- package/README.md +66 -0
- package/dist/agents/claude_code.d.ts +11 -0
- package/dist/agents/claude_code.js +162 -0
- package/dist/agents/claude_code.js.map +1 -0
- package/dist/agents/codex_cli.d.ts +15 -0
- package/dist/agents/codex_cli.js +67 -0
- package/dist/agents/codex_cli.js.map +1 -0
- package/dist/agents/cursor.d.ts +21 -0
- package/dist/agents/cursor.js +89 -0
- package/dist/agents/cursor.js.map +1 -0
- package/dist/agents/registry.d.ts +184 -0
- package/dist/agents/registry.js +212 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/types.d.ts +279 -0
- package/dist/agents/types.js +67 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/commands/connect.d.ts +36 -0
- package/dist/commands/connect.js +499 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/context.d.ts +45 -0
- package/dist/commands/context.js +14 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/report.d.ts +105 -0
- package/dist/commands/report.js +430 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/status.d.ts +29 -0
- package/dist/commands/status.js +236 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/why.d.ts +349 -0
- package/dist/commands/why.js +937 -0
- package/dist/commands/why.js.map +1 -0
- package/dist/consent.d.ts +59 -0
- package/dist/consent.js +111 -0
- package/dist/consent.js.map +1 -0
- package/dist/copy/claims.d.ts +79 -0
- package/dist/copy/claims.js +343 -0
- package/dist/copy/claims.js.map +1 -0
- package/dist/copy/grades.d.ts +117 -0
- package/dist/copy/grades.js +96 -0
- package/dist/copy/grades.js.map +1 -0
- package/dist/copy/index.d.ts +12 -0
- package/dist/copy/index.js +13 -0
- package/dist/copy/index.js.map +1 -0
- package/dist/copy/strings.d.ts +1328 -0
- package/dist/copy/strings.js +1243 -0
- package/dist/copy/strings.js.map +1 -0
- package/dist/copy/time.d.ts +27 -0
- package/dist/copy/time.js +43 -0
- package/dist/copy/time.js.map +1 -0
- package/dist/credential.d.ts +211 -0
- package/dist/credential.js +298 -0
- package/dist/credential.js.map +1 -0
- package/dist/exit.d.ts +59 -0
- package/dist/exit.js +60 -0
- package/dist/exit.js.map +1 -0
- package/dist/git.d.ts +299 -0
- package/dist/git.js +653 -0
- package/dist/git.js.map +1 -0
- package/dist/hooks/entry.d.ts +277 -0
- package/dist/hooks/entry.js +1092 -0
- package/dist/hooks/entry.js.map +1 -0
- package/dist/hooks/post_commit.d.ts +59 -0
- package/dist/hooks/post_commit.js +160 -0
- package/dist/hooks/post_commit.js.map +1 -0
- package/dist/hooks/post_rewrite.d.ts +59 -0
- package/dist/hooks/post_rewrite.js +161 -0
- package/dist/hooks/post_rewrite.js.map +1 -0
- package/dist/hooks/session_end.d.ts +101 -0
- package/dist/hooks/session_end.js +120 -0
- package/dist/hooks/session_end.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +360 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +153 -0
- package/dist/install.js +284 -0
- package/dist/install.js.map +1 -0
- package/dist/json.d.ts +100 -0
- package/dist/json.js +94 -0
- package/dist/json.js.map +1 -0
- package/dist/oauth/discovery.d.ts +96 -0
- package/dist/oauth/discovery.js +163 -0
- package/dist/oauth/discovery.js.map +1 -0
- package/dist/oauth/lock.d.ts +100 -0
- package/dist/oauth/lock.js +287 -0
- package/dist/oauth/lock.js.map +1 -0
- package/dist/oauth/loopback.d.ts +85 -0
- package/dist/oauth/loopback.js +124 -0
- package/dist/oauth/loopback.js.map +1 -0
- package/dist/oauth/pkce.d.ts +58 -0
- package/dist/oauth/pkce.js +77 -0
- package/dist/oauth/pkce.js.map +1 -0
- package/dist/oauth/read.d.ts +120 -0
- package/dist/oauth/read.js +144 -0
- package/dist/oauth/read.js.map +1 -0
- package/dist/oauth/session.d.ts +80 -0
- package/dist/oauth/session.js +112 -0
- package/dist/oauth/session.js.map +1 -0
- package/dist/oauth/signin.d.ts +178 -0
- package/dist/oauth/signin.js +225 -0
- package/dist/oauth/signin.js.map +1 -0
- package/dist/oauth/token.d.ts +139 -0
- package/dist/oauth/token.js +183 -0
- package/dist/oauth/token.js.map +1 -0
- package/dist/paths.d.ts +366 -0
- package/dist/paths.js +460 -0
- package/dist/paths.js.map +1 -0
- package/dist/policy.d.ts +195 -0
- package/dist/policy.js +244 -0
- package/dist/policy.js.map +1 -0
- package/dist/post.d.ts +302 -0
- package/dist/post.js +384 -0
- package/dist/post.js.map +1 -0
- package/dist/project.d.ts +99 -0
- package/dist/project.js +192 -0
- package/dist/project.js.map +1 -0
- package/dist/redact.d.ts +175 -0
- package/dist/redact.js +700 -0
- package/dist/redact.js.map +1 -0
- package/dist/runtime.d.ts +30 -0
- package/dist/runtime.js +37 -0
- package/dist/runtime.js.map +1 -0
- package/dist/spawn_budget.d.ts +101 -0
- package/dist/spawn_budget.js +124 -0
- package/dist/spawn_budget.js.map +1 -0
- package/dist/spool.d.ts +390 -0
- package/dist/spool.js +556 -0
- package/dist/spool.js.map +1 -0
- package/dist/state.d.ts +109 -0
- package/dist/state.js +217 -0
- package/dist/state.js.map +1 -0
- package/dist/system_message.d.ts +101 -0
- package/dist/system_message.js +141 -0
- package/dist/system_message.js.map +1 -0
- package/dist/term.d.ts +112 -0
- package/dist/term.js +134 -0
- package/dist/term.js.map +1 -0
- package/dist/version.d.ts +16 -0
- package/dist/version.js +17 -0
- package/dist/version.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/hooks/entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,MAAM,SAAS,CA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,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACrB,IAAI,CAAC;gBACH,SAAS,CAAC,EAAE,CAAC,CAAC;YAChB,CAAC;YAAC,MAAM,CAAC;gBACP,iDAAiD;YACnD,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vibecommit post-commit` — the verb git's own `post-commit` hook invokes.
|
|
3
|
+
*
|
|
4
|
+
* ## This is the only place a commit is ever OBSERVED (`CR-170`, D154)
|
|
5
|
+
*
|
|
6
|
+
* `observed` had no producer in any repo, and the alternative — inferring
|
|
7
|
+
* commits from a `Bash(git commit)` tool_use — yields NO EDGE AT ALL for
|
|
8
|
+
* `make`, `just`, `gh`, an alias or a script, which is the common path (D56).
|
|
9
|
+
* A commit hook sees all of them, because git runs it regardless of who typed
|
|
10
|
+
* what.
|
|
11
|
+
*
|
|
12
|
+
* ⛔ **AND IT SEES ONLY COMMITS.** `post-commit` does not fire for `git pull`
|
|
13
|
+
* (a merge runs `post-merge`), `checkout` or `reset` — so the three conditions
|
|
14
|
+
* a polling design had to GUESS at are structural here rather than heuristic.
|
|
15
|
+
* That is the whole argument for the mechanism, and it is why ref moves are
|
|
16
|
+
* observed separately, by `headRef` on the Claude Code hook path.
|
|
17
|
+
*
|
|
18
|
+
* ## ⛔ THIS RUNS INSIDE THE USER'S `git commit`
|
|
19
|
+
*
|
|
20
|
+
* Three rules follow, and none of them is defensive tidiness:
|
|
21
|
+
*
|
|
22
|
+
* - **Never throws, always exits 0.** MEASURED 2026-08-17: git ignores
|
|
23
|
+
* `post-commit`'s exit code entirely (a hook exiting 7 leaves `git commit`
|
|
24
|
+
* at 0), so this cannot break a commit — but an uncaught exception would
|
|
25
|
+
* still print a stack into the terminal where someone is working.
|
|
26
|
+
* - **Never writes to stdout or stderr.** That output lands in their commit.
|
|
27
|
+
* - **No network.** Delivery belongs on the hook path, which already has a
|
|
28
|
+
* credential, a budget and a retry story. This writes a line and returns.
|
|
29
|
+
*
|
|
30
|
+
* ⚠ **NO SPAWN BUDGET IS ARMED HERE, deliberately.** `spawn_budget.ts` is opt-in
|
|
31
|
+
* and only `runHook` arms it, so the probes below get their own ceilings. That
|
|
32
|
+
* is correct: this is git's process, not the 5s Claude Code hook path, and
|
|
33
|
+
* `TODOS[87]`'s watchdog does not exist here to be defeated.
|
|
34
|
+
*/
|
|
35
|
+
export interface PostCommitEnvironment {
|
|
36
|
+
readonly home: string;
|
|
37
|
+
readonly cwd: string;
|
|
38
|
+
/**
|
|
39
|
+
* ⛔ **THE COMMITTING PROCESS'S OWN ENVIRONMENT — the first rung of the ladder
|
|
40
|
+
* (`M1`, D183 §1).**
|
|
41
|
+
*
|
|
42
|
+
* Passed, never read from `process.env` here, for the reason every other
|
|
43
|
+
* function on this path takes it: a module that reads the real environment
|
|
44
|
+
* cannot be tested without the developer's own session id — and this one WOULD
|
|
45
|
+
* pick it up, because Claude Code exports `CLAUDE_CODE_SESSION_ID` into the
|
|
46
|
+
* Bash tool env and git passes it straight through to us.
|
|
47
|
+
*/
|
|
48
|
+
readonly env: NodeJS.ProcessEnv;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Observe the commit that just happened, or do nothing.
|
|
52
|
+
*
|
|
53
|
+
* Returns the spool entry written, or null — exposed as a value rather than
|
|
54
|
+
* kept internal so the tests can assert WHAT was observed, not merely that the
|
|
55
|
+
* call survived. Every refusal below is a `null`, and each is a different
|
|
56
|
+
* reason with the same silence.
|
|
57
|
+
*/
|
|
58
|
+
export declare function runPostCommit(ctx: PostCommitEnvironment): number;
|
|
59
|
+
export declare function observe(ctx: PostCommitEnvironment): boolean;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vibecommit post-commit` — the verb git's own `post-commit` hook invokes.
|
|
3
|
+
*
|
|
4
|
+
* ## This is the only place a commit is ever OBSERVED (`CR-170`, D154)
|
|
5
|
+
*
|
|
6
|
+
* `observed` had no producer in any repo, and the alternative — inferring
|
|
7
|
+
* commits from a `Bash(git commit)` tool_use — yields NO EDGE AT ALL for
|
|
8
|
+
* `make`, `just`, `gh`, an alias or a script, which is the common path (D56).
|
|
9
|
+
* A commit hook sees all of them, because git runs it regardless of who typed
|
|
10
|
+
* what.
|
|
11
|
+
*
|
|
12
|
+
* ⛔ **AND IT SEES ONLY COMMITS.** `post-commit` does not fire for `git pull`
|
|
13
|
+
* (a merge runs `post-merge`), `checkout` or `reset` — so the three conditions
|
|
14
|
+
* a polling design had to GUESS at are structural here rather than heuristic.
|
|
15
|
+
* That is the whole argument for the mechanism, and it is why ref moves are
|
|
16
|
+
* observed separately, by `headRef` on the Claude Code hook path.
|
|
17
|
+
*
|
|
18
|
+
* ## ⛔ THIS RUNS INSIDE THE USER'S `git commit`
|
|
19
|
+
*
|
|
20
|
+
* Three rules follow, and none of them is defensive tidiness:
|
|
21
|
+
*
|
|
22
|
+
* - **Never throws, always exits 0.** MEASURED 2026-08-17: git ignores
|
|
23
|
+
* `post-commit`'s exit code entirely (a hook exiting 7 leaves `git commit`
|
|
24
|
+
* at 0), so this cannot break a commit — but an uncaught exception would
|
|
25
|
+
* still print a stack into the terminal where someone is working.
|
|
26
|
+
* - **Never writes to stdout or stderr.** That output lands in their commit.
|
|
27
|
+
* - **No network.** Delivery belongs on the hook path, which already has a
|
|
28
|
+
* credential, a budget and a retry story. This writes a line and returns.
|
|
29
|
+
*
|
|
30
|
+
* ⚠ **NO SPAWN BUDGET IS ARMED HERE, deliberately.** `spawn_budget.ts` is opt-in
|
|
31
|
+
* and only `runHook` arms it, so the probes below get their own ceilings. That
|
|
32
|
+
* is correct: this is git's process, not the 5s Claude Code hook path, and
|
|
33
|
+
* `TODOS[87]`'s watchdog does not exist here to be defeated.
|
|
34
|
+
*/
|
|
35
|
+
import { EXIT } from "../exit.js";
|
|
36
|
+
import { DEFAULT_AGENT_ID, dialectFor } from "../agents/registry.js";
|
|
37
|
+
import { isProjectAllowed } from "../consent.js";
|
|
38
|
+
import { gitProbe, headRef } from "../git.js";
|
|
39
|
+
import { resolveProjectKeys } from "../project.js";
|
|
40
|
+
import { activeSessionFor, appendSpool } from "../spool.js";
|
|
41
|
+
/**
|
|
42
|
+
* Observe the commit that just happened, or do nothing.
|
|
43
|
+
*
|
|
44
|
+
* Returns the spool entry written, or null — exposed as a value rather than
|
|
45
|
+
* kept internal so the tests can assert WHAT was observed, not merely that the
|
|
46
|
+
* call survived. Every refusal below is a `null`, and each is a different
|
|
47
|
+
* reason with the same silence.
|
|
48
|
+
*/
|
|
49
|
+
export function runPostCommit(ctx) {
|
|
50
|
+
try {
|
|
51
|
+
observe(ctx);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// The contract is silence. There is no channel to report on and no caller
|
|
55
|
+
// who could act: git has already made the commit.
|
|
56
|
+
}
|
|
57
|
+
return EXIT.ok;
|
|
58
|
+
}
|
|
59
|
+
export function observe(ctx) {
|
|
60
|
+
// ⛔ BOTH KEYS, AND ONLY ONE OF THE SIX USES BELOW MOVES (`D184 §1`). The
|
|
61
|
+
// consent gate keys on the git COMMON DIR; the session bucket, the `repoKey`
|
|
62
|
+
// and every `git -C` in this function stay on the worktree TOPLEVEL. They were
|
|
63
|
+
// one value until `D184` and the variable name did not change, so read what
|
|
64
|
+
// each line DOES with it — `resolveProjectKeys` exists so taking the wrong one
|
|
65
|
+
// has to be deliberate.
|
|
66
|
+
//
|
|
67
|
+
// ⚠ +1 spawn on git's own process, accepted on the record (`D184 §6`): this
|
|
68
|
+
// hook arms no spawn budget (`:30-33`), so the probe takes its own 5s ceiling
|
|
69
|
+
// and the watchdog `TODOS[87]` defeats does not exist on this path.
|
|
70
|
+
const keys = resolveProjectKeys(ctx.cwd);
|
|
71
|
+
if (keys === null)
|
|
72
|
+
return false;
|
|
73
|
+
const toplevel = keys.worktree;
|
|
74
|
+
// ⛔ THE CONSENT GATE, on the same key the Claude Code hook uses. A repo the
|
|
75
|
+
// user declined must not have its commits recorded either.
|
|
76
|
+
//
|
|
77
|
+
// ⛔ IT IS `keys.consent` OR THE COMMIT GATE IS A HALF-FLIP. `entry.ts` checks
|
|
78
|
+
// the common dir and `connect` grants it; a `post_commit` still checking the
|
|
79
|
+
// toplevel would refuse every commit in every repository — silently, because
|
|
80
|
+
// silence is this file's whole contract — while transcript capture worked
|
|
81
|
+
// fine. That asymmetry is invisible to any cell that grants and checks through
|
|
82
|
+
// one helper (`D184 §9`).
|
|
83
|
+
if (!isProjectAllowed(ctx.home, keys.consent))
|
|
84
|
+
return false;
|
|
85
|
+
// ⛔ THE SESSION GATE — WHICH SESSION, NOT WHOSE HANDS.
|
|
86
|
+
//
|
|
87
|
+
// ⚠ **This comment used to say it is "the one that keeps a HUMAN'S commit
|
|
88
|
+
// out", and that has been FALSE since `CR-170` shipped** — not since D5, and
|
|
89
|
+
// not because of the ladder. `activeSessionFor` gates on a session being active
|
|
90
|
+
// in this clone and has never inspected authorship; the paragraph three lines
|
|
91
|
+
// below already said so, in this same file, about this same hook. Corrected as
|
|
92
|
+
// a comment fix.
|
|
93
|
+
//
|
|
94
|
+
// What the gate really does is refuse when no capture session is live here, and
|
|
95
|
+
// — since the ladder — SAY HOW IT DECIDED. `sole_live_session` still writes for
|
|
96
|
+
// a human's commit in a clone with one live session, exactly as it did at HEAD.
|
|
97
|
+
const active = activeSessionFor(ctx.home, toplevel, envSessionId(ctx.env));
|
|
98
|
+
if (active === null)
|
|
99
|
+
return false;
|
|
100
|
+
const head = headRef(toplevel);
|
|
101
|
+
// No HEAD means a repository with no commits, which cannot be the state
|
|
102
|
+
// immediately after one — so this is a git we could not read, not a case.
|
|
103
|
+
if (head === null)
|
|
104
|
+
return false;
|
|
105
|
+
return appendSpool(ctx.home, { repoKey: toplevel, sessionId: active.sessionId }, {
|
|
106
|
+
sha: head.sha,
|
|
107
|
+
branch: head.branch,
|
|
108
|
+
at: committedAt(toplevel),
|
|
109
|
+
// ⚠ Gathered here because it is FREE here and impossible later: the file
|
|
110
|
+
// list is a property of the commit, and reconstructing it server-side
|
|
111
|
+
// would need the repository. It stays in the spool for wave 2 and never
|
|
112
|
+
// reaches a header (`CR-170` §4).
|
|
113
|
+
files: changedFiles(toplevel),
|
|
114
|
+
// ⛔ RECORDED AT OBSERVATION TIME, because the evidence expires. By the
|
|
115
|
+
// time the next hook delivers this line, the environment belonged to a
|
|
116
|
+
// process that has exited and the mtimes have all moved on — the rung
|
|
117
|
+
// could not be re-derived from anything then, only re-guessed.
|
|
118
|
+
attribution: active.attribution,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The committing session's own id, or null.
|
|
123
|
+
*
|
|
124
|
+
* ⛔ **THE DIALECT ANSWERS, NOT THIS FILE.** `sessionIdFromEnv` is a required
|
|
125
|
+
* member precisely so a new agent has to declare its own variable rather than
|
|
126
|
+
* inherit a guess (`D3`), and reading `CLAUDE_CODE_SESSION_ID` here would put a
|
|
127
|
+
* second, quieter copy of that knowledge outside the registry.
|
|
128
|
+
*
|
|
129
|
+
* ⚠ **`DEFAULT_AGENT_ID`, because git hands this hook no `--agent=` flag** — the
|
|
130
|
+
* installed script is `vibecommit post-commit`, with no argv to read. Asking
|
|
131
|
+
* every dialect instead would be identical today (the other two answer `null`,
|
|
132
|
+
* UNMEASURED) and would invent a precedence rule nobody has needed yet.
|
|
133
|
+
*
|
|
134
|
+
* ⚠ A value from the WRONG agent is survivable by construction: the ladder's
|
|
135
|
+
* first rung requires a live state file to agree with it, and an id that
|
|
136
|
+
* corroborates nothing drops to the HOLD rung rather than naming anyone.
|
|
137
|
+
*/
|
|
138
|
+
function envSessionId(env) {
|
|
139
|
+
return dialectFor(DEFAULT_AGENT_ID).sessionIdFromEnv(env);
|
|
140
|
+
}
|
|
141
|
+
/** git's own `%cI` — strict ISO-8601, the committer date. */
|
|
142
|
+
function committedAt(dir) {
|
|
143
|
+
const out = gitProbe(dir, ["log", "-1", "--format=%cI"]);
|
|
144
|
+
return out === null ? "" : out.trim();
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The paths this commit touched.
|
|
148
|
+
*
|
|
149
|
+
* `--no-commit-id --name-only -r` against `HEAD`. ⚠ A MERGE COMMIT yields
|
|
150
|
+
* nothing here — `diff-tree` emits no single diff for one — and that is left as
|
|
151
|
+
* it is rather than papered over with `-m`, which would emit the diff against
|
|
152
|
+
* every parent and multiply the list.
|
|
153
|
+
*/
|
|
154
|
+
function changedFiles(dir) {
|
|
155
|
+
const out = gitProbe(dir, ["diff-tree", "--no-commit-id", "--name-only", "-r", "HEAD"]);
|
|
156
|
+
if (out === null)
|
|
157
|
+
return [];
|
|
158
|
+
return out.split("\n").map((l) => l.trim()).filter((l) => l !== "");
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=post_commit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post_commit.js","sourceRoot":"","sources":["../../src/hooks/post_commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkB5D;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,GAA0B;IACtD,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAAC,MAAM,CAAC;QACP,0EAA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,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vibecommit post-rewrite` — the verb git's own `post-rewrite` hook invokes.
|
|
3
|
+
*
|
|
4
|
+
* ## ⛔ WHY IT EXISTS: `post-commit` OBSERVES A SHA THE REWRITE THEN DESTROYS
|
|
5
|
+
*
|
|
6
|
+
* **`M5`: `--amend` and `rebase` both fire `post-commit`, and destroy the sha
|
|
7
|
+
* they fired for.** `--amend` fires `post-commit` for the pre-amend sha AND for
|
|
8
|
+
* the amended one; a `rebase -i` squash fires it for the new sha. **The
|
|
9
|
+
* pre-rewrite sha is unreachable from every branch and gone after
|
|
10
|
+
* `gc --prune=now`** — so nothing downstream can discover, later, that the two
|
|
11
|
+
* commits are the same work. The pairing has to be recorded while git still
|
|
12
|
+
* knows it, and `post-rewrite` is the only hook that is told.
|
|
13
|
+
*
|
|
14
|
+
* **`M6`: the pairs arrive on STDIN.** `argv[1]` is `amend` or `rebase`; stdin
|
|
15
|
+
* carries `<ancestor> <successor>` per line. That is `commit_sha_successors`'
|
|
16
|
+
* shape verbatim, so there is no new table and no migration.
|
|
17
|
+
*
|
|
18
|
+
* ## ⛔ TWO GUARDS, AND THEY ARE NOT REDUNDANCY
|
|
19
|
+
*
|
|
20
|
+
* `M6` measured the squash hazard across sizes and **it is SIZE-DEPENDENT**:
|
|
21
|
+
*
|
|
22
|
+
* | Squash | Fires | Hazard |
|
|
23
|
+
* |---|---|---|
|
|
24
|
+
* | 3 → 1 | `amend A→F` · `rebase A→F; B→F` | ⛔ **duplicate pair** (`A→F` twice) |
|
|
25
|
+
* | 4 → 1 | `amend A→I` · `amend I→F` · `rebase A→F; B→F; C→F` | ⛔ **two rows name `I`**, a sha that never existed on any branch and is gc-able |
|
|
26
|
+
*
|
|
27
|
+
* ⚠ **NEITHER IS THE GENERAL CASE.** The suppression below kills the dead
|
|
28
|
+
* intermediates; `appendRewrites`' dedup kills the duplicate. **One squash size
|
|
29
|
+
* cannot exercise both**, and a review that saw only one concluded a guard was
|
|
30
|
+
* pointless.
|
|
31
|
+
*
|
|
32
|
+
* ## ⛔ THIS RUNS INSIDE THE USER'S `git rebase`
|
|
33
|
+
*
|
|
34
|
+
* The same three rules `post_commit.ts` states, for the same reasons: **never
|
|
35
|
+
* throws, always exits 0; never writes to stdout or stderr; no network.** And,
|
|
36
|
+
* as there, **NO SPAWN BUDGET IS ARMED** — `spawn_budget.ts` is opt-in and only
|
|
37
|
+
* `runHook` arms it, so the probes here take their own ceilings. This is git's
|
|
38
|
+
* process, not the 5s Claude Code hook path.
|
|
39
|
+
*/
|
|
40
|
+
export interface PostRewriteEnvironment {
|
|
41
|
+
readonly home: string;
|
|
42
|
+
readonly cwd: string;
|
|
43
|
+
/** See `PostCommitEnvironment.env` — passed, never read from `process.env`. */
|
|
44
|
+
readonly env: NodeJS.ProcessEnv;
|
|
45
|
+
/** git's own `argv[1]`: `amend` or `rebase`. Anything else is not ours to read. */
|
|
46
|
+
readonly kind: string;
|
|
47
|
+
/** The whole of stdin. Read by the caller so this module opens nothing. */
|
|
48
|
+
readonly stdin: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Record the rewrite that just happened, or do nothing.
|
|
52
|
+
*
|
|
53
|
+
* Exits 0 unconditionally — git ignores a `post-rewrite` exit code, but an
|
|
54
|
+
* uncaught exception would still print a stack into the terminal where someone
|
|
55
|
+
* is rebasing.
|
|
56
|
+
*/
|
|
57
|
+
export declare function runPostRewrite(ctx: PostRewriteEnvironment): number;
|
|
58
|
+
/** How many pairs were newly spooled. Zero is an ordinary answer. */
|
|
59
|
+
export declare function observeRewrites(ctx: PostRewriteEnvironment): number;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vibecommit post-rewrite` — the verb git's own `post-rewrite` hook invokes.
|
|
3
|
+
*
|
|
4
|
+
* ## ⛔ WHY IT EXISTS: `post-commit` OBSERVES A SHA THE REWRITE THEN DESTROYS
|
|
5
|
+
*
|
|
6
|
+
* **`M5`: `--amend` and `rebase` both fire `post-commit`, and destroy the sha
|
|
7
|
+
* they fired for.** `--amend` fires `post-commit` for the pre-amend sha AND for
|
|
8
|
+
* the amended one; a `rebase -i` squash fires it for the new sha. **The
|
|
9
|
+
* pre-rewrite sha is unreachable from every branch and gone after
|
|
10
|
+
* `gc --prune=now`** — so nothing downstream can discover, later, that the two
|
|
11
|
+
* commits are the same work. The pairing has to be recorded while git still
|
|
12
|
+
* knows it, and `post-rewrite` is the only hook that is told.
|
|
13
|
+
*
|
|
14
|
+
* **`M6`: the pairs arrive on STDIN.** `argv[1]` is `amend` or `rebase`; stdin
|
|
15
|
+
* carries `<ancestor> <successor>` per line. That is `commit_sha_successors`'
|
|
16
|
+
* shape verbatim, so there is no new table and no migration.
|
|
17
|
+
*
|
|
18
|
+
* ## ⛔ TWO GUARDS, AND THEY ARE NOT REDUNDANCY
|
|
19
|
+
*
|
|
20
|
+
* `M6` measured the squash hazard across sizes and **it is SIZE-DEPENDENT**:
|
|
21
|
+
*
|
|
22
|
+
* | Squash | Fires | Hazard |
|
|
23
|
+
* |---|---|---|
|
|
24
|
+
* | 3 → 1 | `amend A→F` · `rebase A→F; B→F` | ⛔ **duplicate pair** (`A→F` twice) |
|
|
25
|
+
* | 4 → 1 | `amend A→I` · `amend I→F` · `rebase A→F; B→F; C→F` | ⛔ **two rows name `I`**, a sha that never existed on any branch and is gc-able |
|
|
26
|
+
*
|
|
27
|
+
* ⚠ **NEITHER IS THE GENERAL CASE.** The suppression below kills the dead
|
|
28
|
+
* intermediates; `appendRewrites`' dedup kills the duplicate. **One squash size
|
|
29
|
+
* cannot exercise both**, and a review that saw only one concluded a guard was
|
|
30
|
+
* pointless.
|
|
31
|
+
*
|
|
32
|
+
* ## ⛔ THIS RUNS INSIDE THE USER'S `git rebase`
|
|
33
|
+
*
|
|
34
|
+
* The same three rules `post_commit.ts` states, for the same reasons: **never
|
|
35
|
+
* throws, always exits 0; never writes to stdout or stderr; no network.** And,
|
|
36
|
+
* as there, **NO SPAWN BUDGET IS ARMED** — `spawn_budget.ts` is opt-in and only
|
|
37
|
+
* `runHook` arms it, so the probes here take their own ceilings. This is git's
|
|
38
|
+
* process, not the 5s Claude Code hook path.
|
|
39
|
+
*/
|
|
40
|
+
import { EXIT } from "../exit.js";
|
|
41
|
+
import { DEFAULT_AGENT_ID, dialectFor } from "../agents/registry.js";
|
|
42
|
+
import { isProjectAllowed } from "../consent.js";
|
|
43
|
+
import { gitProbe } from "../git.js";
|
|
44
|
+
import { resolveProjectKeys } from "../project.js";
|
|
45
|
+
import { activeSessionFor, appendRewrites, isFullSha } from "../spool.js";
|
|
46
|
+
import { existsSync } from "node:fs";
|
|
47
|
+
import { isAbsolute, join } from "node:path";
|
|
48
|
+
/**
|
|
49
|
+
* Record the rewrite that just happened, or do nothing.
|
|
50
|
+
*
|
|
51
|
+
* Exits 0 unconditionally — git ignores a `post-rewrite` exit code, but an
|
|
52
|
+
* uncaught exception would still print a stack into the terminal where someone
|
|
53
|
+
* is rebasing.
|
|
54
|
+
*/
|
|
55
|
+
export function runPostRewrite(ctx) {
|
|
56
|
+
try {
|
|
57
|
+
observeRewrites(ctx);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// The contract is silence. There is no channel to report on and no caller
|
|
61
|
+
// who could act: git has already rewritten the commits.
|
|
62
|
+
}
|
|
63
|
+
return EXIT.ok;
|
|
64
|
+
}
|
|
65
|
+
/** How many pairs were newly spooled. Zero is an ordinary answer. */
|
|
66
|
+
export function observeRewrites(ctx) {
|
|
67
|
+
const pairs = parsePairs(ctx.stdin);
|
|
68
|
+
if (pairs.length === 0)
|
|
69
|
+
return 0;
|
|
70
|
+
// ⛔ BOTH KEYS, AS IN `post_commit.ts` (`D184 §1`): the consent gate keys on the
|
|
71
|
+
// git COMMON DIR, and every `git -C` and the session bucket stay on the
|
|
72
|
+
// worktree TOPLEVEL. The variable name does not tell you which is which.
|
|
73
|
+
const keys = resolveProjectKeys(ctx.cwd);
|
|
74
|
+
if (keys === null)
|
|
75
|
+
return 0;
|
|
76
|
+
const toplevel = keys.worktree;
|
|
77
|
+
// ⛔ GUARD 1 — SUPPRESS `amend` WHILE A REBASE IS IN PROGRESS.
|
|
78
|
+
//
|
|
79
|
+
// A `rebase -i` squash fires this hook as `amend` for each intermediate commit
|
|
80
|
+
// it builds along the way, and those intermediates are **discarded**: a 4 → 1
|
|
81
|
+
// squash produces two rows naming a sha that never existed on any branch and is
|
|
82
|
+
// gc-able. The final `rebase` fire carries the pairs that are actually true.
|
|
83
|
+
//
|
|
84
|
+
// ⛔ **MEASURED, and the predicate is exactly this**: `.git/rebase-merge`
|
|
85
|
+
// EXISTS during ALL fires of a `rebase -i`, including both `amend` ones, and
|
|
86
|
+
// does NOT exist for a plain `git commit --amend`. `.git/rebase-apply` never
|
|
87
|
+
// appears for `-i` at all, so it is not consulted.
|
|
88
|
+
//
|
|
89
|
+
// ⚠ It must not swallow an ordinary `--amend`, which is the other cell.
|
|
90
|
+
if (ctx.kind === "amend" && rebaseInProgress(toplevel))
|
|
91
|
+
return 0;
|
|
92
|
+
if (!isProjectAllowed(ctx.home, keys.consent))
|
|
93
|
+
return 0;
|
|
94
|
+
// ⚠ THE SESSION BUCKET, AND THE RUNG IS DELIBERATELY NOT CONSULTED. A pair
|
|
95
|
+
// asserts a relation between two SHAs — `A was rewritten to B` — and claims
|
|
96
|
+
// nothing about who did it, so there is no attribution to be wrong about and
|
|
97
|
+
// nothing for it to put on `x-commit-attributions`. The ladder is used here for
|
|
98
|
+
// the one thing it still decides on this path: which session's spool the pair
|
|
99
|
+
// belongs in, so that the next hook for that session delivers it.
|
|
100
|
+
const active = activeSessionFor(ctx.home, toplevel, envSessionId(ctx.env));
|
|
101
|
+
if (active === null)
|
|
102
|
+
return 0;
|
|
103
|
+
return appendRewrites(ctx.home, { repoKey: toplevel, sessionId: active.sessionId }, pairs);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Is a rebase running right now?
|
|
107
|
+
*
|
|
108
|
+
* ⛔ **THE PATH COMES FROM GIT, NOT FROM JOINING `.git` ONTO THE TOPLEVEL.** A
|
|
109
|
+
* linked worktree's rebase state is its own and does not live in the main clone's
|
|
110
|
+
* git dir, and `--git-common-dir`'s answer is relative in a main clone and
|
|
111
|
+
* absolute in a worktree (`M3`, D184 §8) — a hand-built path is right in exactly
|
|
112
|
+
* one of those shapes. `--git-path` answers for the shape it is actually in, and
|
|
113
|
+
* is resolved against `dir` because that is the directory git ran in.
|
|
114
|
+
*
|
|
115
|
+
* ⚠ A probe failure resolves to FALSE — *not in a rebase* — which is the arm that
|
|
116
|
+
* RECORDS the pair. That is the correct direction here: the cost of a false
|
|
117
|
+
* negative is one extra pair that dedup or the server's own self-pair drop will
|
|
118
|
+
* handle, while a false positive silently discards a real `--amend`.
|
|
119
|
+
*/
|
|
120
|
+
function rebaseInProgress(dir) {
|
|
121
|
+
const out = gitProbe(dir, ["rev-parse", "--git-path", "rebase-merge"]);
|
|
122
|
+
if (out === null)
|
|
123
|
+
return false;
|
|
124
|
+
const path = out.trim();
|
|
125
|
+
if (path === "")
|
|
126
|
+
return false;
|
|
127
|
+
return existsSync(isAbsolute(path) ? path : join(dir, path));
|
|
128
|
+
}
|
|
129
|
+
/** See `post_commit.ts`'s copy — the dialect answers, and this file does not read the variable. */
|
|
130
|
+
function envSessionId(env) {
|
|
131
|
+
return dialectFor(DEFAULT_AGENT_ID).sessionIdFromEnv(env);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* `<ancestor> <successor>` per line, whitespace-separated.
|
|
135
|
+
*
|
|
136
|
+
* ⚠ **git may append a third field** — the `rebase` form carries extra info for
|
|
137
|
+
* some invocations — so the line is split and the first two fields are taken
|
|
138
|
+
* rather than requiring exactly two. A malformed line is SKIPPED, never fatal:
|
|
139
|
+
* this is a stream from another program, and losing one pair beats losing the
|
|
140
|
+
* batch.
|
|
141
|
+
*
|
|
142
|
+
* ⚠ A self-pair is dropped here as well as in the spool's parser. `parseRewritePairs`
|
|
143
|
+
* drops it server-side too, and a pair that survives to occupy one of the 16 wire
|
|
144
|
+
* slots while meaning nothing is a slot a real pair needed.
|
|
145
|
+
*/
|
|
146
|
+
function parsePairs(stdin) {
|
|
147
|
+
const out = [];
|
|
148
|
+
for (const line of stdin.split("\n")) {
|
|
149
|
+
const fields = line.trim().split(/\s+/);
|
|
150
|
+
if (fields.length < 2)
|
|
151
|
+
continue;
|
|
152
|
+
const [ancestor, successor] = fields;
|
|
153
|
+
if (!isFullSha(ancestor) || !isFullSha(successor))
|
|
154
|
+
continue;
|
|
155
|
+
if (ancestor === successor)
|
|
156
|
+
continue;
|
|
157
|
+
out.push({ ancestor, successor });
|
|
158
|
+
}
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=post_rewrite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post_rewrite.js","sourceRoot":"","sources":["../../src/hooks/post_rewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AAE5F,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAa7C;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAA2B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S;QAC5D,IAAI,QAAQ,KAAK,SAAS;YAAE,SAAS;QACrC,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `SessionEnd` settles before it reads — `CR-020d`, D57 §DX7.
|
|
3
|
+
*
|
|
4
|
+
* The finding, verbatim: *"`SessionEnd` settles and re-reads inside its timeout.
|
|
5
|
+
* `transcript_path` is documented as written asynchronously and may lag;
|
|
6
|
+
* `SessionEnd` has no next event, so D56's advance-regardless loses the final
|
|
7
|
+
* turn **permanently**."*
|
|
8
|
+
*
|
|
9
|
+
* ## Why only this event
|
|
10
|
+
*
|
|
11
|
+
* The client's whole design tolerates a lagging write: read what is there, leave
|
|
12
|
+
* the offset where it lands, and let the NEXT invocation pick up whatever the
|
|
13
|
+
* write had not flushed yet. `Stop` and `PreCompact` both have a next
|
|
14
|
+
* invocation. `SessionEnd` does not — it is the last hook of the session, so
|
|
15
|
+
* bytes missed here are missed forever, and they are the bytes of the final
|
|
16
|
+
* turn, which is the one a user is most likely to go looking for.
|
|
17
|
+
*
|
|
18
|
+
* So the fix is narrow on purpose: one event pays the cost, and `Stop` behaves
|
|
19
|
+
* exactly as it did before this task. `test/contract.test.ts` asserts that
|
|
20
|
+
* negative half directly, because a change that quietly made every event settle
|
|
21
|
+
* would pass the positive test just as well.
|
|
22
|
+
*
|
|
23
|
+
* ## One wait, not a poll loop
|
|
24
|
+
*
|
|
25
|
+
* The task is "settle-and-reread", singular. D56 §D8 is a founder override that
|
|
26
|
+
* a hook must never block or slow a developer's turn, and "wait until the file
|
|
27
|
+
* stops growing" has no natural upper bound — under load it is unbounded exactly
|
|
28
|
+
* when blocking is least affordable. A single named wait is the simplest thing
|
|
29
|
+
* that closes the finding, and its cost is knowable by reading one constant.
|
|
30
|
+
*
|
|
31
|
+
* ## This module holds no I/O and no clock
|
|
32
|
+
*
|
|
33
|
+
* `settledSize` takes both, for the same reason `policy.ts` is pure: the whole
|
|
34
|
+
* settle rule is then testable without a real 250 ms of wall clock and without a
|
|
35
|
+
* filesystem, and the one place that does touch either is the caller.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* The event name Claude Code sends on stdin as `hook_event_name` for the last
|
|
39
|
+
* hook of a session. DESIGN.md §13.7 governs it alongside `Stop` and
|
|
40
|
+
* `PreCompact`; this task changes WHEN bytes are read, never the exit contract.
|
|
41
|
+
*/
|
|
42
|
+
export declare const SESSION_END_EVENT = "SessionEnd";
|
|
43
|
+
/**
|
|
44
|
+
* How long to let the transcript settle. **250 ms, and the number is reasoned.**
|
|
45
|
+
*
|
|
46
|
+
* The lag being covered is a local filesystem write-flush artifact — Claude
|
|
47
|
+
* Code's own process appending JSONL lines to a file this process is about to
|
|
48
|
+
* stat — not a network round trip. That puts the expected lag in the
|
|
49
|
+
* tens-of-milliseconds range, so 250 ms is roughly an order of magnitude of
|
|
50
|
+
* margin over the effect it is covering, while staying a twentieth of the
|
|
51
|
+
* default 5 s budget.
|
|
52
|
+
*
|
|
53
|
+
* It is deliberately NOT larger. Every millisecond here is taken from the send
|
|
54
|
+
* that follows (see `settleDelayMs`), and a settle generous enough to cover a
|
|
55
|
+
* pathologically slow write would starve the upload it exists to make complete.
|
|
56
|
+
* If evidence ever shows real lag above this, change the constant and say why —
|
|
57
|
+
* it is one number in one place precisely so that stays cheap.
|
|
58
|
+
*/
|
|
59
|
+
export declare const SESSION_END_SETTLE_DELAY_MS = 250;
|
|
60
|
+
/**
|
|
61
|
+
* The most of the hook's budget the settle may ever claim.
|
|
62
|
+
*
|
|
63
|
+
* The settle is carved OUT of the existing budget, never added on top of it, so
|
|
64
|
+
* it competes with the send. This cap is what keeps the constant above safe at
|
|
65
|
+
* any budget: on the 5 s default it never binds (0.3 × 5000 = 1500 ≫ 250), and
|
|
66
|
+
* on a budget small enough that a flat 250 ms would swallow the invocation it
|
|
67
|
+
* scales the settle down instead of eating the send.
|
|
68
|
+
*/
|
|
69
|
+
export declare const SETTLE_BUDGET_FRACTION = 0.3;
|
|
70
|
+
/**
|
|
71
|
+
* How long to actually settle, given this invocation's whole budget.
|
|
72
|
+
*
|
|
73
|
+
* The override exists for the same two reasons `resolveCaps` has one
|
|
74
|
+
* (`policy.ts`): an operator on a filesystem slower than this constant assumes
|
|
75
|
+
* can raise it without a release, and the end-to-end test has to widen the
|
|
76
|
+
* window to land an append inside it deterministically rather than racing a
|
|
77
|
+
* child's boot — which varies by an order of magnitude under load (`CR-126`).
|
|
78
|
+
*
|
|
79
|
+
* Unset or unparseable takes the default rather than disabling the settle: a
|
|
80
|
+
* window an empty string can switch off is not a window. The budget cap still
|
|
81
|
+
* applies to the override, so it can widen the settle but never let it swallow
|
|
82
|
+
* the send.
|
|
83
|
+
*/
|
|
84
|
+
export declare function settleDelayMs(env: NodeJS.ProcessEnv, budgetMs: number): number;
|
|
85
|
+
/**
|
|
86
|
+
* The transcript's size after letting a lagging write land.
|
|
87
|
+
*
|
|
88
|
+
* Read, wait, read again, and take the LARGER. Growth is the case this exists
|
|
89
|
+
* for: the first read raced a write in progress, and the second sees the final
|
|
90
|
+
* turn the first one missed.
|
|
91
|
+
*
|
|
92
|
+
* **A SHORTER second read keeps the first.** That is truncation or rotation — a
|
|
93
|
+
* different and much rarer failure mode, which this task deliberately does not
|
|
94
|
+
* try to solve; `nextSpan` already resyncs from 0 when the offset sits past EOF,
|
|
95
|
+
* and `readSpan` already sends only the bytes actually present. Named as a known
|
|
96
|
+
* gap rather than handled speculatively.
|
|
97
|
+
*
|
|
98
|
+
* A `null` second read (the file went away mid-settle) also keeps the first, for
|
|
99
|
+
* the same reason: what we saw is better evidence than what we can no longer see.
|
|
100
|
+
*/
|
|
101
|
+
export declare function settledSize(sizeOf: () => number | null, wait: (ms: number) => Promise<void>, delayMs: number): Promise<number | null>;
|