Skip to content

fix(identity): fire the provider limit from the test so late-settle tests have a fixed order (lr-7da984) - #485

Merged
clagentic-merger[bot] merged 1 commit into
mainfrom
fix/lr-7da984-identity-late-settle-deterministic
Oct 23, 2026
Merged

clagentic-merger[bot] merged 1 commit into
mainfrom
fix/lr-7da984-identity-late-settle-deterministic

Conversation

@clagentic-builder

Copy link
Copy Markdown
Contributor

TASK: lr-7da984

What

The three identity late-settle tests (module provider, jwks-self, gatekeeper) raced a provider against a wall-clock limit (1 ms and 100 ms). They now run in a fixed order: the test fires the provider limit itself.

  • lib/identity/index.js: new internal options.timers ({ setTimeout, clearTimeout }) on createIdentity, default the global timers. Production behaviour unchanged; no public config; nothing in the console sets it.
  • test/identity-surface.test.js: manualTimers() fires the limit on demand; module providers park on a gate the test opens after the limit fired; jwks-self runs the REAL signer, with the limit fired in the same synchronous step that starts it; the gatekeeper test fires the limit only after the fake client has started (it records env.log first thing). Waiting for late effects uses a bounded until(...) on observable events instead of fixed sleeps. Assertions are unchanged. The gatekeeper 1200 ms pause stays as the observation window for a client that was not cancelled; the order no longer depends on it.

Why a seam, not test-only

The jwks-self and gatekeeper providers are built inside createIdentity, so a test cannot wrap them, and the limit is a private timer in askProvider that the test cannot order against the client start. The gatekeeper flake mechanism: under load the 100 ms limit cancelled the client before it ever ran, so env.log was empty and inheritedDirs() was [] rather than ["undefined"].

Mutation checks (each reverted)

  1. allocateDir without the abandoned check and removeMade a no-op (holder.js): module-after-allocate fails at "no directory remains under the spawn root" (actual [cc-...]); module-before-allocate fails at "never happened: the refusal of the late directory request"; jwks-self fails at "never happened: the signer late request for a directory".
  2. controller.abort() removed (index.js): gatekeeper fails at "the issuer late session never came into being or was removed" (actual [.../spawn/gk-...]).
  3. timeout branch disabled (if (false)): all three fail at provider_timeout (actual provider_result_invalid).

Tests

  • 20 of 20 consecutive isolated runs of test/identity-surface.test.js pass (34 tests each, about 2.4 s per run).
  • Full npm test: exit 0, failing-test-ID set empty. The profile has no test block (clagentic-loadout test exits 72), so npm test was used.
  • Known-flake wording: searched the repo for "pending-timeout under load" and found no entry; nothing to update.
  • CREW_SOP section 6: the diff changes a test and an off-by-default option, no hook, gate or runner.

🤖 Generated with Claude Code

…ests have a fixed order (lr-7da984)

Adds an internal options.timers seam to createIdentity (default: the global timers) and drives the module, jwks-self and gatekeeper late-settle tests from it instead of racing a provider against a wall-clock limit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@clagentic-reviewer

Copy link
Copy Markdown

PEACHES — clean (0 finding(s), 1 dropped)
verdict: CLEAN
range: e8e9833..576832b
engine: carrier: gpt-5.6-sol

Dropped candidates (1):

  • lib/identity/index.js:98 [amos.code-craft.12] The exported createIdentity options now expose a test-only clock seam, making internal timeout mechanics part of the caller-visible API. (reason: Settled by HOLDEN spec ruling 2: the options.timers test seam in lib/identity/index.js is accepted, off by default, with no public config and no production caller; the candidate states no failure mode and no impact, so it is not a defensible finding and the settled verdict is not re-argued)
{"reviewer": "peaches", "review_status": "clean", "head_sha": "576832b94829bd2f2359a36d8d1b2bb7a7e6e61e", "pr_number": 485, "dropped": [{"file": "lib/identity/index.js", "line": 98, "rule_id": "amos.code-craft.12", "message": "The exported createIdentity options now expose a test-only clock seam, making internal timeout mechanics part of the caller-visible API.", "reason": "Settled by HOLDEN spec ruling 2: the options.timers test seam in lib/identity/index.js is accepted, off by default, with no public config and no production caller; the candidate states no failure mode and no impact, so it is not a defensible finding and the settled verdict is not re-argued"}], "range": {"basis": "base..head", "base": "e8e98338ea3dd12a18b5b009b9c10ee20a3d1c89", "head": "576832b94829bd2f2359a36d8d1b2bb7a7e6e61e"}, "engines": [{"engine": "carrier", "model": "gpt-5.6-sol", "chunks": 1}], "verdict_outcome": "CLEAN", "verdict_reasons": [], "evaluator_version": "2", "policy_base_sha": "e8e98338ea3dd12a18b5b009b9c10ee20a3d1c89", "evaluated_findings": [], "fence_schema_version": 3}

@clagentic-security

Copy link
Copy Markdown

BOBBIE — clean (0 finding(s))
verdict: CLEAN
range: e8e9833..576832b
engine: carrier: gpt-5.6-sol

{"reviewer": "bobbie", "review_status": "clean", "head_sha": "576832b94829bd2f2359a36d8d1b2bb7a7e6e61e", "pr_number": 485, "scanners_run": [{"scanner": "gitleaks", "status": "ran"}, {"scanner": "trufflehog", "status": "ran"}, {"scanner": "semgrep", "status": "ran"}, {"scanner": "osv-scanner", "status": "not_applicable", "reason": "no packages found to scan"}], "fence_schema_version": 3, "range": {"basis": "base..head", "base": "e8e98338ea3dd12a18b5b009b9c10ee20a3d1c89", "head": "576832b94829bd2f2359a36d8d1b2bb7a7e6e61e"}, "engines": [{"engine": "carrier", "model": "gpt-5.6-sol", "chunks": 1}], "verdict_outcome": "CLEAN", "verdict_reasons": [], "evaluator_version": "2", "policy_base_sha": "e8e98338ea3dd12a18b5b009b9c10ee20a3d1c89", "evaluated_findings": []}

@clagentic-merger
clagentic-merger Bot merged commit 06b5660 into main Oct 23, 2026
6 checks passed
@clagentic-merger
clagentic-merger Bot deleted the fix/lr-7da984-identity-late-settle-deterministic branch October 23, 2026 17:00
@clagentic-merger

Copy link
Copy Markdown
Contributor

Merged via clagentic-loadout v0.2.0

Field Value
Gated HEAD SHA 576832b94829bd2f2359a36d8d1b2bb7a7e6e61e
Merged SHA 576832b94829bd2f2359a36d8d1b2bb7a7e6e61e
Reviews clagentic-reviewer[bot], clagentic-security[bot]
Verdicts peaches: fence CLEAN, gate CLEAN
bobbie: fence CLEAN, gate CLEAN
CI status combined_state='pending' (ignored: 0 commit statuses, so the check-runs decide) (0 status(es), 6 run(s); source=check-runs)
task_id lr-7da984

@clagentic-release-bot

Copy link
Copy Markdown
Contributor

This issue has been resolved in version 1.11.0-beta.2.

To update, run:

npx @clagentic/console@1.11.0-beta.2

@clagentic-release-bot

Copy link
Copy Markdown
Contributor

This issue has been resolved in version 1.11.0.

To update, run:

npx @clagentic/console@1.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants