@tokenfactory/acc-runner 0.40.25 → 0.40.27
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/chat-poll/index.d.ts +132 -0
- package/dist/chat-poll/index.d.ts.map +1 -0
- package/dist/chat-poll/index.js +200 -0
- package/dist/chat-poll/index.js.map +1 -0
- package/dist/doctor.d.ts +15 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +45 -0
- package/dist/doctor.js.map +1 -1
- package/dist/git-auth/classify.d.ts +16 -0
- package/dist/git-auth/classify.d.ts.map +1 -0
- package/dist/git-auth/classify.js +51 -0
- package/dist/git-auth/classify.js.map +1 -0
- package/dist/git-auth/controller.d.ts +70 -0
- package/dist/git-auth/controller.d.ts.map +1 -0
- package/dist/git-auth/controller.js +83 -0
- package/dist/git-auth/controller.js.map +1 -0
- package/dist/git-auth/index.d.ts +14 -0
- package/dist/git-auth/index.d.ts.map +1 -0
- package/dist/git-auth/index.js +14 -0
- package/dist/git-auth/index.js.map +1 -0
- package/dist/git-auth/probe.d.ts +34 -0
- package/dist/git-auth/probe.d.ts.map +1 -0
- package/dist/git-auth/probe.js +72 -0
- package/dist/git-auth/probe.js.map +1 -0
- package/dist/watch.d.ts +38 -0
- package/dist/watch.d.ts.map +1 -1
- package/dist/watch.js +132 -1
- package/dist/watch.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Auth = operator must fix the credential. Transient = worth a retry/probe. */
|
|
2
|
+
export type GitFetchFailureClass = "auth" | "transient";
|
|
3
|
+
/**
|
|
4
|
+
* Substrings (lower-cased) that mean the credential itself is the problem. Kept
|
|
5
|
+
* as a superset of ../git.ts's push terminalPatterns plus the read-path shapes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GIT_AUTH_FAILURE_PATTERNS: readonly string[];
|
|
8
|
+
/**
|
|
9
|
+
* Classify a fetch/ls-remote failure. Defaults to "transient" for anything that
|
|
10
|
+
* doesn't match an auth shape, so a genuine network drop keeps its retry/probe
|
|
11
|
+
* loop and only a real credential failure trips the degraded state.
|
|
12
|
+
*/
|
|
13
|
+
export declare function classifyGitFetchError(err: unknown): GitFetchFailureClass;
|
|
14
|
+
/** Convenience predicate for call sites that only care whether it's auth-class. */
|
|
15
|
+
export declare function isGitAuthFailure(err: unknown): boolean;
|
|
16
|
+
//# sourceMappingURL=classify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/git-auth/classify.ts"],"names":[],"mappings":"AAmBA,gFAAgF;AAChF,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,WAAW,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAsB7C,CAAC;AAWX;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CAIxE;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Substrings (lower-cased) that mean the credential itself is the problem. Kept
|
|
3
|
+
* as a superset of ../git.ts's push terminalPatterns plus the read-path shapes.
|
|
4
|
+
*/
|
|
5
|
+
export const GIT_AUTH_FAILURE_PATTERNS = [
|
|
6
|
+
"authentication failed",
|
|
7
|
+
"permission denied",
|
|
8
|
+
"remote: permission",
|
|
9
|
+
"could not read username",
|
|
10
|
+
"could not read password",
|
|
11
|
+
"terminal prompts disabled",
|
|
12
|
+
"no anonymous write access",
|
|
13
|
+
"403 forbidden",
|
|
14
|
+
"error: 403",
|
|
15
|
+
"the requested url returned error: 403",
|
|
16
|
+
"401 unauthorized",
|
|
17
|
+
"error: 401",
|
|
18
|
+
"the requested url returned error: 401",
|
|
19
|
+
"write access to repository not granted",
|
|
20
|
+
"gh auth login",
|
|
21
|
+
"support for password authentication was removed",
|
|
22
|
+
"invalid username or token",
|
|
23
|
+
"invalid username or password",
|
|
24
|
+
"bad credentials",
|
|
25
|
+
"authentication is required",
|
|
26
|
+
"fatal: authentication",
|
|
27
|
+
];
|
|
28
|
+
function haystackFor(err) {
|
|
29
|
+
const e = err;
|
|
30
|
+
const stderr = typeof e?.stderr === "string" ? e.stderr : "";
|
|
31
|
+
const message = typeof e?.message === "string" ? e.message : "";
|
|
32
|
+
// A plain string throw (or a value that stringifies) is still worth scanning.
|
|
33
|
+
const raw = typeof err === "string" ? err : "";
|
|
34
|
+
return `${stderr}\n${message}\n${raw}`.toLowerCase();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Classify a fetch/ls-remote failure. Defaults to "transient" for anything that
|
|
38
|
+
* doesn't match an auth shape, so a genuine network drop keeps its retry/probe
|
|
39
|
+
* loop and only a real credential failure trips the degraded state.
|
|
40
|
+
*/
|
|
41
|
+
export function classifyGitFetchError(err) {
|
|
42
|
+
const haystack = haystackFor(err);
|
|
43
|
+
if (GIT_AUTH_FAILURE_PATTERNS.some((p) => haystack.includes(p)))
|
|
44
|
+
return "auth";
|
|
45
|
+
return "transient";
|
|
46
|
+
}
|
|
47
|
+
/** Convenience predicate for call sites that only care whether it's auth-class. */
|
|
48
|
+
export function isGitAuthFailure(err) {
|
|
49
|
+
return classifyGitFetchError(err) === "auth";
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=classify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../../src/git-auth/classify.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,uBAAuB;IACvB,mBAAmB;IACnB,oBAAoB;IACpB,yBAAyB;IACzB,yBAAyB;IACzB,2BAA2B;IAC3B,2BAA2B;IAC3B,eAAe;IACf,YAAY;IACZ,uCAAuC;IACvC,kBAAk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, no git of its own) so it is
|
|
5
|
+
* trivially unit-testable with a fake probe; watch.ts owns the timer that drives
|
|
6
|
+
* `check()` every 60s and supplies the real probe + the emit/gate callbacks.
|
|
7
|
+
* This mirrors the AS-3 resume-controller split (primitive here, wiring in
|
|
8
|
+
* watch.ts).
|
|
9
|
+
*
|
|
10
|
+
* Behaviour (from the task spec):
|
|
11
|
+
* - Count CONSECUTIVE auth-class probe failures. A successful probe resets the
|
|
12
|
+
* count to 0; a transient (network) failure leaves it untouched — only a
|
|
13
|
+
* real credential failure moves the runner toward degraded, and only a real
|
|
14
|
+
* fetch success clears it.
|
|
15
|
+
* - On the Nth consecutive auth failure (default N=2) trip `degraded` and fire
|
|
16
|
+
* `onDegraded` ONCE. While degraded, keep probing; the FIRST success fires
|
|
17
|
+
* `onRecovered` ONCE and clears `degraded`.
|
|
18
|
+
* Callbacks are awaited but never allowed to reject `check()` — a failed emit
|
|
19
|
+
* must not corrupt the state machine or wedge the probe loop.
|
|
20
|
+
*/
|
|
21
|
+
import type { GitAuthProbe, GitAuthProbeResult } from "./probe.js";
|
|
22
|
+
export declare const DEFAULT_GIT_AUTH_FAILURE_THRESHOLD = 2;
|
|
23
|
+
export interface GitAuthDegradedInfo {
|
|
24
|
+
/** How many consecutive auth-class failures tripped the degraded state. */
|
|
25
|
+
consecutiveFailures: number;
|
|
26
|
+
/** Masked failure detail from the probe that tripped it. */
|
|
27
|
+
detail: string;
|
|
28
|
+
}
|
|
29
|
+
export interface GitAuthRecoveredInfo {
|
|
30
|
+
/** How long (probe attempts) the runner was degraded before recovering. */
|
|
31
|
+
failuresBeforeRecovery: number;
|
|
32
|
+
/** Masked detail from the successful probe. */
|
|
33
|
+
detail: string;
|
|
34
|
+
}
|
|
35
|
+
export interface GitAuthControllerDeps {
|
|
36
|
+
probe: GitAuthProbe;
|
|
37
|
+
/** Fired once on the transition into degraded. */
|
|
38
|
+
onDegraded?: (info: GitAuthDegradedInfo) => void | Promise<void>;
|
|
39
|
+
/** Fired once on the transition back to healthy. */
|
|
40
|
+
onRecovered?: (info: GitAuthRecoveredInfo) => void | Promise<void>;
|
|
41
|
+
/** Consecutive auth failures before tripping degraded. Default 2. */
|
|
42
|
+
threshold?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface GitAuthSnapshot {
|
|
45
|
+
degraded: boolean;
|
|
46
|
+
consecutiveAuthFailures: number;
|
|
47
|
+
lastDetail: string;
|
|
48
|
+
}
|
|
49
|
+
export declare class GitAuthController {
|
|
50
|
+
private readonly deps;
|
|
51
|
+
private readonly threshold;
|
|
52
|
+
private _degraded;
|
|
53
|
+
private _consecutiveAuthFailures;
|
|
54
|
+
private _peakConsecutive;
|
|
55
|
+
private _lastDetail;
|
|
56
|
+
constructor(deps: GitAuthControllerDeps);
|
|
57
|
+
get degraded(): boolean;
|
|
58
|
+
get consecutiveAuthFailures(): number;
|
|
59
|
+
snapshot(): GitAuthSnapshot;
|
|
60
|
+
/**
|
|
61
|
+
* Run one probe, fold the result into the state machine, and fire the
|
|
62
|
+
* transition callback when (and only when) the degraded state flips. Never
|
|
63
|
+
* rejects: a throwing probe is treated as transient and a throwing callback is
|
|
64
|
+
* swallowed (best-effort emit).
|
|
65
|
+
*/
|
|
66
|
+
check(): Promise<GitAuthProbeResult>;
|
|
67
|
+
private apply;
|
|
68
|
+
private fire;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/git-auth/controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEnE,eAAO,MAAM,kCAAkC,IAAI,CAAC;AAEpD,MAAM,WAAW,mBAAmB;IAClC,2EAA2E;IAC3E,mBAAmB,EAAE,MAAM,CAAC;IAC5B,4DAA4D;IAC5D,MAAM,EAAE,MAAM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
+
_consecutiveAuthFailures = 0;
|
|
7
|
+
_peakConsecutive = 0;
|
|
8
|
+
_lastDetail = "";
|
|
9
|
+
constructor(deps) {
|
|
10
|
+
this.deps = deps;
|
|
11
|
+
this.threshold = Math.max(1, Math.floor(deps.threshold ?? DEFAULT_GIT_AUTH_FAILURE_THRESHOLD));
|
|
12
|
+
}
|
|
13
|
+
get degraded() {
|
|
14
|
+
return this._degraded;
|
|
15
|
+
}
|
|
16
|
+
get consecutiveAuthFailures() {
|
|
17
|
+
return this._consecutiveAuthFailures;
|
|
18
|
+
}
|
|
19
|
+
snapshot() {
|
|
20
|
+
return {
|
|
21
|
+
degraded: this._degraded,
|
|
22
|
+
consecutiveAuthFailures: this._consecutiveAuthFailures,
|
|
23
|
+
lastDetail: this._lastDetail,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Run one probe, fold the result into the state machine, and fire the
|
|
28
|
+
* transition callback when (and only when) the degraded state flips. Never
|
|
29
|
+
* rejects: a throwing probe is treated as transient and a throwing callback is
|
|
30
|
+
* swallowed (best-effort emit).
|
|
31
|
+
*/
|
|
32
|
+
async check() {
|
|
33
|
+
let result;
|
|
34
|
+
try {
|
|
35
|
+
result = await this.deps.probe();
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
result = {
|
|
39
|
+
ok: false,
|
|
40
|
+
failureClass: "transient",
|
|
41
|
+
detail: err?.message?.split(/\r?\n/)[0] ?? String(err),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
this._lastDetail = result.detail;
|
|
45
|
+
await this.apply(result);
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
async apply(result) {
|
|
49
|
+
if (result.ok) {
|
|
50
|
+
const failuresBeforeRecovery = this._peakConsecutive;
|
|
51
|
+
this._consecutiveAuthFailures = 0;
|
|
52
|
+
this._peakConsecutive = 0;
|
|
53
|
+
if (this._degraded) {
|
|
54
|
+
this._degraded = false;
|
|
55
|
+
await this.fire(() => this.deps.onRecovered?.({ failuresBeforeRecovery, detail: result.detail }));
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (result.failureClass === "auth") {
|
|
60
|
+
this._consecutiveAuthFailures += 1;
|
|
61
|
+
this._peakConsecutive = Math.max(this._peakConsecutive, this._consecutiveAuthFailures);
|
|
62
|
+
if (!this._degraded && this._consecutiveAuthFailures >= this.threshold) {
|
|
63
|
+
this._degraded = true;
|
|
64
|
+
await this.fire(() => this.deps.onDegraded?.({
|
|
65
|
+
consecutiveFailures: this._consecutiveAuthFailures,
|
|
66
|
+
detail: result.detail,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// transient failure: leave counters + degraded state untouched. A network
|
|
71
|
+
// blip while healthy stays healthy; while degraded, only a real success
|
|
72
|
+
// (above) recovers — never a transient blip.
|
|
73
|
+
}
|
|
74
|
+
async fire(fn) {
|
|
75
|
+
try {
|
|
76
|
+
await fn();
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
/* best-effort emit — never wedge the probe loop on a callback error. */
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/git-auth/controller.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC;AAgCpD,MAAM,OAAO,iBAAiB;IAOC;IANZ,SAAS,CAAS;IAC3B,SAAS,GAAG,KAAK,CAAC;IAClB,wBAAwB,GAAG,CAAC,CAAC;IAC7B,gBAAgB,GAAG,CAAC,CAAC;IACrB,WAAW,GAAG,EAAE,CAAC;IAEzB,YAA6B,IAA2B;QAA3B,SAAI,GAAJ,IAAI,CAAuB;QACtD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE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vB,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CACnB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAC3E,CAAC;YACJ,CAAC;YACD,OAAO;QACT,CAAC;QAED,IAAI,MAAM,CAAC,YAAY,KAAK,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,wBAAwB,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;YACvF,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,wBAAwB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACvE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;gBACtB,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CACnB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;oBACrB,mBAAmB,EAAE,IAAI,CAAC,wBAAwB;oBAClD,MAAM,EAAE,MAAM,CAAC,MAAM;iBACtB,CAAC,CACH,CAAC;YACJ,CAAC;QACH,CAAC;QACD,0EAA0E;QAC1E,wEAAwE;QACxE,6CAA6C;IAC/C,CAAC;IAEO,KAAK,CAAC,IAAI,CAAC,EAA8B;QAC/C,IAAI,CAAC;YACH,MAAM,EAAE,EAAE,CAAC;QACb,CAAC;QAAC,MAAM,CAAC;YACP,wEAAwE;QAC1E,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GIT-AUTH-ALERT: runner git-credential health — classify auth-class transport
|
|
3
|
+
* failures, probe the base clone's credential (masked), and drive a degraded
|
|
4
|
+
* state machine so watch.ts can pause task-lane claiming instead of churning
|
|
5
|
+
* doomed claim→fail→requeue cycles when a token expires.
|
|
6
|
+
*/
|
|
7
|
+
export { classifyGitFetchError, isGitAuthFailure, GIT_AUTH_FAILURE_PATTERNS, type GitFetchFailureClass, } from "./classify.js";
|
|
8
|
+
export { makeGitAuthProbe, maskGitCredentials, type GitAuthProbe, type GitAuthProbeResult, type DefaultProbeOptions, } from "./probe.js";
|
|
9
|
+
export { GitAuthController, DEFAULT_GIT_AUTH_FAILURE_THRESHOLD, type GitAuthControllerDeps, type GitAuthDegradedInfo, type GitAuthRecoveredInfo, type GitAuthSnapshot, } from "./controller.js";
|
|
10
|
+
/** Runner-emitted audit verbs. The alerts tick (api/_lib/alerts-git-auth.ts) */
|
|
11
|
+
/** scans these to derive currently-degraded machines and page the operator. */
|
|
12
|
+
export declare const RUNNER_GIT_AUTH_FAILED_VERB = "runner.git_auth_failed";
|
|
13
|
+
export declare const RUNNER_GIT_AUTH_RECOVERED_VERB = "runner.git_auth_recovered";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/git-auth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,kCAAkC,EAClC,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAC;AAEzB,gFAAgF;AAChF,+EAA+E;AAC/E,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AACpE,eAAO,MAAM,8BAA8B,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GIT-AUTH-ALERT: runner git-credential health — classify auth-class transport
|
|
3
|
+
* failures, probe the base clone's credential (masked), and drive a degraded
|
|
4
|
+
* state machine so watch.ts can pause task-lane claiming instead of churning
|
|
5
|
+
* doomed claim→fail→requeue cycles when a token expires.
|
|
6
|
+
*/
|
|
7
|
+
export { classifyGitFetchError, isGitAuthFailure, GIT_AUTH_FAILURE_PATTERNS, } from "./classify.js";
|
|
8
|
+
export { makeGitAuthProbe, maskGitCredentials, } from "./probe.js";
|
|
9
|
+
export { GitAuthController, DEFAULT_GIT_AUTH_FAILURE_THRESHOLD, } from "./controller.js";
|
|
10
|
+
/** Runner-emitted audit verbs. The alerts tick (api/_lib/alerts-git-auth.ts) */
|
|
11
|
+
/** scans these to derive currently-degraded machines and page the operator. */
|
|
12
|
+
export const RUNNER_GIT_AUTH_FAILED_VERB = "runner.git_auth_failed";
|
|
13
|
+
export const RUNNER_GIT_AUTH_RECOVERED_VERB = "runner.git_auth_recovered";
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/git-auth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,GAE1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GAInB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,kCAAkC,GAKnC,MAAM,iBAAiB,CAAC;AAEzB,gFAAgF;AAChF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,2BAA2B,GAAG,wBAAwB,CAAC;AACpE,MAAM,CAAC,MAAM,8BAA8B,GAAG,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type GitFetchFailureClass } from "./classify.js";
|
|
2
|
+
export interface GitAuthProbeResult {
|
|
3
|
+
/** True when the ls-remote succeeded (the credential is valid). */
|
|
4
|
+
ok: boolean;
|
|
5
|
+
/** null when ok; otherwise how the failure was classified. */
|
|
6
|
+
failureClass: GitFetchFailureClass | null;
|
|
7
|
+
/** Masked, credential-safe one-line summary — safe to log/emit/display. */
|
|
8
|
+
detail: string;
|
|
9
|
+
}
|
|
10
|
+
/** The injectable seam. Production uses `defaultGitAuthProbe`; tests fake it. */
|
|
11
|
+
export type GitAuthProbe = () => Promise<GitAuthProbeResult>;
|
|
12
|
+
/**
|
|
13
|
+
* Redact credential material from arbitrary git output. Covers:
|
|
14
|
+
* - userinfo in URLs: scheme://user:token@host → scheme://***@host
|
|
15
|
+
* - GitHub token shapes anywhere: ghp_/gho_/ghu_/ghs_/ghr_…, github_pat_…
|
|
16
|
+
* Idempotent and never throws; a masked-but-imperfect string is preferred to
|
|
17
|
+
* leaking, so callers can mask defensively at every boundary.
|
|
18
|
+
*/
|
|
19
|
+
export declare function maskGitCredentials(input: string): string;
|
|
20
|
+
export interface DefaultProbeOptions {
|
|
21
|
+
/** The local clone to probe (its `origin` remote carries the credential). */
|
|
22
|
+
repoPath: string;
|
|
23
|
+
/** Test seam — overrides the git invocation. */
|
|
24
|
+
run?: (repoPath: string, args: string[]) => Promise<{
|
|
25
|
+
stdout: string;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build a `GitAuthProbe` bound to a repo path. `GIT_TERMINAL_PROMPT=0` is forced
|
|
30
|
+
* on so a missing credential fails FAST with "terminal prompts disabled" instead
|
|
31
|
+
* of hanging waiting for an interactive username/password.
|
|
32
|
+
*/
|
|
33
|
+
export declare function makeGitAuthProbe(opts: DefaultProbeOptions): GitAuthProbe;
|
|
34
|
+
//# sourceMappingURL=probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../../src/git-auth/probe.ts"],"names":[],"mappings":"AAaA,OAAO,EAAyB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEjF,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,EAAE,EAAE,OAAO,CAAC;IACZ,8DAA8D;IAC9D,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1C,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASxD;AAQD,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzE;AAeD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,GAAG,YAAY,CAmBxE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GIT-AUTH-ALERT: a masked, read-only git-credential health probe.
|
|
3
|
+
*
|
|
4
|
+
* Runs `git ls-remote --heads origin` in the runner's base clone — a dry-run
|
|
5
|
+
* that touches the remote (so an expired/revoked token 403s exactly as a real
|
|
6
|
+
* fetch would) but transfers no objects, so it is cheap enough to run every 60s
|
|
7
|
+
* both to DETECT the initial failure and to poll for RECOVERY. The result is a
|
|
8
|
+
* three-way `{ ok, failureClass, detail }` where `detail` is ALWAYS masked so no
|
|
9
|
+
* credential material (a token embedded in the remote URL, a `x-access-token:…`
|
|
10
|
+
* pair, a raw PAT) can reach a log line, an activity event, or `doctor` output.
|
|
11
|
+
*/
|
|
12
|
+
import { execa } from "execa";
|
|
13
|
+
import { buildEnv } from "../bin-resolve.js";
|
|
14
|
+
import { classifyGitFetchError } from "./classify.js";
|
|
15
|
+
/**
|
|
16
|
+
* Redact credential material from arbitrary git output. Covers:
|
|
17
|
+
* - userinfo in URLs: scheme://user:token@host → scheme://***@host
|
|
18
|
+
* - GitHub token shapes anywhere: ghp_/gho_/ghu_/ghs_/ghr_…, github_pat_…
|
|
19
|
+
* Idempotent and never throws; a masked-but-imperfect string is preferred to
|
|
20
|
+
* leaking, so callers can mask defensively at every boundary.
|
|
21
|
+
*/
|
|
22
|
+
export function maskGitCredentials(input) {
|
|
23
|
+
if (!input)
|
|
24
|
+
return input;
|
|
25
|
+
let out = input;
|
|
26
|
+
// scheme://userinfo@host — strip everything between the scheme and the '@'.
|
|
27
|
+
out = out.replace(/([a-z][a-z0-9+.-]*:\/\/)[^\s/@]+@/gi, "$1***@");
|
|
28
|
+
// Bare GitHub token shapes that might appear outside a URL (e.g. in an error).
|
|
29
|
+
out = out.replace(/\bgh[posru]_[A-Za-z0-9]{16,}\b/g, "***");
|
|
30
|
+
out = out.replace(/\bgithub_pat_[A-Za-z0-9_]{20,}\b/g, "***");
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
/** First non-empty line of a message, masked and length-bounded. */
|
|
34
|
+
function summarize(raw) {
|
|
35
|
+
const firstLine = raw.split(/\r?\n/).find((l) => l.trim().length > 0) ?? raw;
|
|
36
|
+
return maskGitCredentials(firstLine.trim()).slice(0, 300);
|
|
37
|
+
}
|
|
38
|
+
async function defaultRun(repoPath, args) {
|
|
39
|
+
// GIT_TERMINAL_PROMPT=0 → a missing credential fails FAST with "terminal
|
|
40
|
+
// prompts disabled" instead of blocking on an interactive username/password.
|
|
41
|
+
const { stdout } = await execa("git", args, {
|
|
42
|
+
cwd: repoPath,
|
|
43
|
+
env: { ...buildEnv(), GIT_TERMINAL_PROMPT: "0" },
|
|
44
|
+
});
|
|
45
|
+
return { stdout };
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build a `GitAuthProbe` bound to a repo path. `GIT_TERMINAL_PROMPT=0` is forced
|
|
49
|
+
* on so a missing credential fails FAST with "terminal prompts disabled" instead
|
|
50
|
+
* of hanging waiting for an interactive username/password.
|
|
51
|
+
*/
|
|
52
|
+
export function makeGitAuthProbe(opts) {
|
|
53
|
+
const run = opts.run ?? defaultRun;
|
|
54
|
+
return async () => {
|
|
55
|
+
try {
|
|
56
|
+
await run(opts.repoPath, ["ls-remote", "--heads", "origin"]);
|
|
57
|
+
return { ok: true, failureClass: null, detail: "ls-remote origin ok" };
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
const failureClass = classifyGitFetchError(err);
|
|
61
|
+
const message = err?.stderr ??
|
|
62
|
+
err?.message ??
|
|
63
|
+
String(err);
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
failureClass,
|
|
67
|
+
detail: summarize(typeof message === "string" ? message : String(message)),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../../src/git-auth/probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAA6B,MAAM,eAAe,CAAC;AAcjF;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,4EAA4E;IAC5E,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,qCAAqC,EAAE,QAAQ,CAAC,CAAC;IACnE,+EAA+E;IAC/E,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,iCAAiC,EAAE,KAAK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AC,GAAG,CAAC,CAAC;YAChD,MAAM,OAAO,GACV,GAA+C,EAAE,MAAM;gBACvD,GAAa,EAAE,OAAO;gBACvB,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,YAAY;gBACZ,MAAM,EAAE,SAAS,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;aAC3E,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/watch.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { runTask, type RunTaskController } from "./task-runner.js";
|
|
|
7
7
|
import { type ReviewAssignment, type ReviewerOutcome } from "./runtime/reviewer.js";
|
|
8
8
|
import { type SingletonLock } from "./runtime/singleton.js";
|
|
9
9
|
import { type SelfUpgradeResult, type SelfUpdate426Result } from "./runtime/self-upgrade.js";
|
|
10
|
+
import { GitAuthController, type GitAuthProbe } from "./git-auth/index.js";
|
|
10
11
|
import { ResumeController, type ResumeControllerDeps } from "./capacity/resume-controller.js";
|
|
11
12
|
import { AccountProbeScheduler } from "./engines/account-probe.js";
|
|
12
13
|
import { type FleetChatServingHandle } from "./watch-chat/wire.js";
|
|
@@ -194,6 +195,23 @@ export interface WatchOptions {
|
|
|
194
195
|
* guard.
|
|
195
196
|
*/
|
|
196
197
|
enforceSingleton?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* GIT-AUTH-ALERT: cadence (ms) of the git-credential health probe. Defaults to
|
|
200
|
+
* 60s. Tests set a large value so only the `gitAuthProbeOnce()` hook drives it.
|
|
201
|
+
*/
|
|
202
|
+
gitAuthProbeIntervalMs?: number;
|
|
203
|
+
/**
|
|
204
|
+
* GIT-AUTH-ALERT: consecutive auth-class probe failures before the runner
|
|
205
|
+
* trips the degraded `git_auth_failed` state. Defaults to 2 (the spec bar).
|
|
206
|
+
*/
|
|
207
|
+
gitAuthFailureThreshold?: number;
|
|
208
|
+
/**
|
|
209
|
+
* GIT-AUTH-ALERT: injectable probe seam. Production builds an `ls-remote`
|
|
210
|
+
* probe bound to the base clone (cfg.worktreeRepoPath ?? cfg.repoPath); tests
|
|
211
|
+
* inject a fake to drive the state machine without shelling out to git. When
|
|
212
|
+
* neither this nor a base repo path is available the probe loop is disabled.
|
|
213
|
+
*/
|
|
214
|
+
gitAuthProbe?: GitAuthProbe;
|
|
197
215
|
}
|
|
198
216
|
/**
|
|
199
217
|
* v0.12.0 (T-52-7): resolve ACC_RUNNER_IDLE_TTL_MIN into ms. Returns null
|
|
@@ -228,6 +246,13 @@ export interface WatchHandle {
|
|
|
228
246
|
* from the backstop timer.
|
|
229
247
|
*/
|
|
230
248
|
claimBackstopOnce(): Promise<void>;
|
|
249
|
+
/**
|
|
250
|
+
* GIT-AUTH-ALERT test hook: forces one git-credential health probe and
|
|
251
|
+
* resolves when it finishes (including any degraded/recovered emit). Resolves
|
|
252
|
+
* to `false` when the probe loop is disabled (no base repo path). Production
|
|
253
|
+
* drives this from the probe timer.
|
|
254
|
+
*/
|
|
255
|
+
gitAuthProbeOnce(): Promise<boolean>;
|
|
231
256
|
/** v0.10 T-49-2: number of tasks currently executing. Useful for tests. */
|
|
232
257
|
runningCount(): number;
|
|
233
258
|
}
|
|
@@ -278,6 +303,19 @@ interface WatchState {
|
|
|
278
303
|
claimBackstopTimer: NodeJS.Timeout;
|
|
279
304
|
claimBackstopIntervalMs: number;
|
|
280
305
|
backstopScanning: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* GIT-AUTH-ALERT: the git-credential health state machine + its timer.
|
|
308
|
+
* `gitAuthController` is null when the probe loop is disabled (no base repo
|
|
309
|
+
* path resolvable, or in tests that don't opt in). `gitAuthFailed` mirrors the
|
|
310
|
+
* controller's degraded flag so pump() can read it synchronously (like the
|
|
311
|
+
* capacity flags) to pause task-lane claiming. `gitAuthChecking` is the
|
|
312
|
+
* single-flight guard so a slow probe can't overlap itself.
|
|
313
|
+
*/
|
|
314
|
+
gitAuthController: GitAuthController | null;
|
|
315
|
+
gitAuthTimer: NodeJS.Timeout | null;
|
|
316
|
+
gitAuthProbeIntervalMs: number;
|
|
317
|
+
gitAuthChecking: boolean;
|
|
318
|
+
gitAuthFailed: boolean;
|
|
281
319
|
/**
|
|
282
320
|
* v0.68 (T-68-1): realtime channel-health recovery. The `.subscribe`
|
|
283
321
|
* status callback previously handled ONLY `SUBSCRIBED`; a `CHANNEL_ERROR`
|
package/dist/watch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAGlB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAG3E,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EAAE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAGlB,MAAM,a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