Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: remove obsolete attestation clock doubles

[._.]/ Adam Eivyb8fd12f2de15
diff --git a/docs/GITHUB_ACTIONS.md b/docs/GITHUB_ACTIONS.md
index da5d1fa045..2480c432a7 100644
--- a/docs/GITHUB_ACTIONS.md
+++ b/docs/GITHUB_ACTIONS.md
@@ -292,9 +292,10 @@ pushed head, and the impact planner skips what it attests to:
- **When it applies.** Only a same-repository pull request into a non-`release`
base that was not forced full. The planner verifies the merge-ref checkout's
second parent is the event's head (so the attested tree is compared with
- the right commit) and reads `repos/{repo}/commits/{head}/statuses`. Statuses are read once: missing or late attestations immediately leave broad
- hosted coverage enabled. Focused pushes intentionally post no attestation,
- so the planner never waits for one.
+ the right commit) and reads `repos/{repo}/commits/{head}/statuses`.
+ Statuses are read once: a missing or late attestation immediately leaves
+ broad hosted coverage enabled. Focused pushes intentionally post no
+ attestation, so the planner never waits for one.
When you open the pull request yourself, the order is push, attest, then
`gh pr create`, so the status precedes the `pull_request` event. Any
failure — API error, unreadable description, tree mismatch, wrong creator,
diff --git a/scripts/ci-test-plan.test.js b/scripts/ci-test-plan.test.js
index 2f3e9af786..3074832fb2 100644
--- a/scripts/ci-test-plan.test.js
+++ b/scripts/ci-test-plan.test.js
@@ -2280,14 +2280,12 @@ describe('pregate attestation', () => {
const status = (overrides = {}) => ({
context: 'pregate', state: 'success', creator: { login: 'acme' }, created_at: '2026-10-18T10:00:00Z', description: encode(ALL), ...overrides,
});
- const NOW = 1_800_000_000_000;
/** An execFileSync double: git answers from the options, gh from `statuses`; a thrown entry throws. */
- const fakeExec = ({ mergeHead = HEAD, headTree = TREE, statuses = [status()], apiError = null, drift = [], committedAt = Math.floor(NOW / 1000) - 3600, calls = [] } = {}) => (command, args) => {
+ const fakeExec = ({ mergeHead = HEAD, headTree = TREE, statuses = [status()], apiError = null, drift = [], calls = [] } = {}) => (command, args) => {
const key = `${command} ${args.join(' ')}`;
calls.push(key);
if (key === 'git rev-parse --verify --quiet HEAD^2') return `${mergeHead}\n`;
if (key === `git rev-parse --verify --quiet ${HEAD}^{tree}`) return `${headTree}\n`;
- if (key === `git show -s --format=%ct ${HEAD}`) return `${committedAt}\n`;
if (key === 'git diff --name-only HEAD^2 HEAD') {
if (drift === null) throw new Error('diff failed');
return `${drift.join('\n')}\n`;
@@ -2301,8 +2299,7 @@ describe('pregate attestation', () => {
throw new Error(`unexpected ${key}`);
};
const quiet = () => {};
- const clock = () => { let t = NOW; return { now: () => t, sleep: (ms) => { t += ms; } }; };
- const resolve = (options = {}, env = prEnv, extra = {}) => resolveCiAttestation({ env, exec: fakeExec(options), log: quiet, ...clock(), ...extra });
+ const resolve = (options = {}, env = prEnv, extra = {}) => resolveCiAttestation({ env, exec: fakeExec(options), log: quiet, ...extra });
const fullPlan = () => buildCiTestPlan(['server/index.js'], { trackedFiles: TRACKED, forceFull: true, forceFullReason: 'full CI requested' });
it('is eligible only for a same-repository, non-bot pull request into a non-release base', () => {
@@ -2328,7 +2325,7 @@ describe('pregate attestation', () => {
const reasons = [];
const log = (line) => reasons.push(line);
const refused = (options, env = prEnv) => {
- const result = resolveCiAttestation({ env, exec: fakeExec(options), log, ...clock() });
+ const result = resolveCiAttestation({ env, exec: fakeExec(options), log });
expect(result.attested).toBe(false);
return result.reason;
};
@@ -2347,18 +2344,13 @@ describe('pregate attestation', () => {
it('reads an absent attestation once and immediately retains broad CI for focused pushes', () => {
let reads = 0;
- const sleeps = [];
- let time = NOW;
const result = resolveCiAttestation({
env: prEnv,
- exec: fakeExec({ statuses: () => { reads += 1; return []; }, committedAt: Math.floor(NOW / 1000) - 60 }),
+ exec: fakeExec({ statuses: () => { reads += 1; return []; } }),
log: quiet,
- now: () => time,
- sleep: ms => { sleeps.push(ms); time += ms; },
});
expect(result).toMatchObject({ attested: false, reason: 'no "pregate" status on the head' });
expect(reads).toBe(1);
- expect(sleeps).toEqual([]);
expect(applyAttestation(fullPlan(), result)).toMatchObject({ full: true, attestedStages: [] });
});