Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .agents/pm/history/pm-github-aplb.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{"hash_algorithm":"sha256","ts":"2026-10-16T07:43:14.293Z","author":"claude-orchestrator","author_source":"asserted","agent_harness":"claude-code","agent_model":"claude-opus-5-5","agent_model_source":"probe","agent_instance":"cd687996088c07eef02d762c","agent_provenance":{"model":{"value":"claude-opus-5-5","source":"probe"},"effort":{"value":"xhigh","source":"environment"},"role":{"value":"implementer","source":"argv"},"topic":null,"version":{"value":"2.1.301","source":"probe"}},"op":"create","patch":[{"op":"add","path":"/metadata/id","value":"pm-github-aplb"},{"op":"add","path":"/metadata/title","value":"Closeout workflow tests race the detached telemetry flush when removing their temporary global root"},{"op":"add","path":"/metadata/description","value":"The 2026.10.16 release run 38867443956 failed in Run release checks: test/closeout-workflow.test.ts 'compact PR summary is privacy gated before the bot branch is published' threw ENOTEMPTY removing <tmp>/global/runtime/telemetry. The pm CLI's detached telemetry flush (upstream pm-cli#1423; follow-up #1484) can still write under PM_GLOBAL_PATH when the caller removes it. The same race hit PR #133 CI. import-gate.test.ts already retries its global-root removal (maxRetries 5, retryDelay 100); the closeout fixture did not."},{"op":"add","path":"/metadata/type","value":"Issue"},{"op":"add","path":"/metadata/status","value":"in_progress"},{"op":"add","path":"/metadata/priority","value":1},{"op":"add","path":"/metadata/tags","value":["ci","fixed","flaky","tests"]},{"op":"add","path":"/metadata/created_at","value":"2026-10-16T07:43:14.293Z"},{"op":"add","path":"/metadata/updated_at","value":"2026-10-16T07:43:14.293Z"},{"op":"add","path":"/metadata/author","value":"claude-orchestrator"},{"op":"add","path":"/metadata/acceptance_criteria","value":"closeout-workflow.test.ts fixture removal retries like import-gate.test.ts; Release run succeeds"},{"op":"add","path":"/metadata/expected_result","value":"Fixture teardown tolerates a concurrent detached flush write"},{"op":"add","path":"/metadata/actual_result","value":"Release run 38867443956 and PR #133 CI failed with ENOTEMPTY during fixture teardown"}],"before_hash":"3cc22dff72be7b14824654a7a64ea62b04799939b2fee54c1b5f52ca60bf6df0","after_hash":"74334ae496f8effc06addb6bf91c9c4db34e861f89120077ec091b592930f88b","item_hash_version":3,"message":"","context":{"agent_provenance_outcomes":{"model":{"status":"resolved","resolver":"claude_session_file","rule_version":"v1"},"version":{"status":"resolved","resolver":"claude_session_file","rule_version":"v1"}}},"event_class":"substantive","record_hash_version":1,"record_hash":"831196dafccffe6946e3ddd66590a631bd492353f46704e9c7a8fcf30472fbee"}
{"hash_algorithm":"sha256","ts":"2026-10-16T07:43:15.393Z","author":"claude-orchestrator","author_source":"asserted","agent_harness":"claude-code","agent_model":"claude-opus-5-5","agent_model_source":"probe","agent_instance":"cd687996088c07eef02d762c","agent_provenance":{"model":{"value":"claude-opus-5-5","source":"probe"},"effort":{"value":"xhigh","source":"environment"},"role":null,"topic":null,"version":{"value":"2.1.301","source":"probe"}},"op":"files_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-10-16T07:43:15.393Z"},{"op":"add","path":"/metadata/files","value":[{"path":"test/closeout-workflow.test.ts","scope":"project"}]}],"before_hash":"74334ae496f8effc06addb6bf91c9c4db34e861f89120077ec091b592930f88b","after_hash":"ac9aed0cde2fb8420e598dcebdc7f63b35a878bd3821ab09963ba0796134c8a6","item_hash_version":3,"context":{"agent_provenance_outcomes":{"model":{"status":"resolved","resolver":"claude_session_file","rule_version":"v1"},"version":{"status":"resolved","resolver":"claude_session_file","rule_version":"v1"}}},"event_class":"maintenance","record_hash_version":1,"record_hash":"7cd0445d7ec43db4218e2112b0008739da1d792c8ac5412082c9f8a4cce11461"}
{"hash_algorithm":"sha256","ts":"2026-10-16T07:52:14.347Z","author":"claude-orchestrator","author_source":"asserted","agent_harness":"claude-code","agent_model":"claude-opus-5-5","agent_model_source":"probe","agent_instance":"cd687996088c07eef02d762c","agent_provenance":{"model":{"value":"claude-opus-5-5","source":"probe"},"effort":{"value":"xhigh","source":"environment"},"role":null,"topic":null,"version":{"value":"2.1.301","source":"probe"}},"op":"comment_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-10-16T07:52:14.347Z"},{"op":"add","path":"/metadata/comments","value":[{"created_at":"2026-10-16T07:52:14.347Z","author":"claude-orchestrator","text":"Fix: closeout-workflow.test.ts fixture teardown now retries the temp-root removal (maxRetries 10, retryDelay 100), matching import-gate.test.ts. Local CI-like run (fresh HOME, no global git config, no GH tokens, built dist): node --test test/closeout-workflow.test.ts 20/20 pass. Root cause upstream: detached telemetry flush writes under PM_GLOBAL_PATH after the CLI exits (pm-cli#1423 fixed root resurrection only; follow-up pm-cli#1484 filed)."}]}],"before_hash":"ac9aed0cde2fb8420e598dcebdc7f63b35a878bd3821ab09963ba0796134c8a6","after_hash":"aaee3c6ef7f32ed6acee74fb95c1921035dfc4140d1910ddf999cc2b6088aa30","item_hash_version":3,"context":{"agent_provenance_outcomes":{"model":{"status":"resolved","resolver":"claude_session_file","rule_version":"v1"},"version":{"status":"resolved","resolver":"claude_session_file","rule_version":"v1"}}},"event_class":"substantive","record_hash_version":1,"record_hash":"f2a3739f6104b75300b8098bad9700d2d568257a6bc4de91fab1f5a2e5ed84f2"}
{"hash_algorithm":"sha256","ts":"2026-10-16T08:41:48.891Z","author":"claude-orchestrator","author_source":"asserted","agent_harness":"claude-code","agent_model":"claude-opus-5-5","agent_model_source":"probe","agent_instance":"cd687996088c07eef02d762c","agent_provenance":{"model":{"value":"claude-opus-5-5","source":"probe"},"effort":{"value":"xhigh","source":"environment"},"role":null,"topic":null,"version":{"value":"2.1.301","source":"probe"}},"op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/1","value":{"created_at":"2026-10-16T08:41:48.891Z","author":"claude-orchestrator","text":"Review round 1 (CodeRabbit): finite rmSync retries cannot outlast a detached flush that may write up to the HTTP timeout later. Both disposable-global-root fixtures (closeout-workflow, import-gate) now set PM_TELEMETRY_INLINE_FLUSH=1 (documented test knob in pm docs/CONFIGURATION.md: flush inline instead of dispatching the detached worker; delivery unchanged). The retry stays as defensive cleanup. Local CI-like run: closeout-workflow 20/20; import-gate has 11 failures locally that reproduce on unchanged main in this host environment (baseline probe), so GitHub CI is the arbiter."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-10-16T08:41:48.891Z"}],"before_hash":"aaee3c6ef7f32ed6acee74fb95c1921035dfc4140d1910ddf999cc2b6088aa30","after_hash":"2291cea3868953c160ab08199eec89393b30b41a6f7ac6ae9de9f132ee1cfbad","item_hash_version":3,"context":{"agent_provenance_outcomes":{"model":{"status":"resolved","resolver":"claude_session_file","rule_version":"v1"},"version":{"status":"resolved","resolver":"claude_session_file","rule_version":"v1"}}},"event_class":"substantive","record_hash_version":1,"record_hash":"41e918e89b3ec3dc25e1a690a388a70f776e64f89bc1d60b0a786126408b36c5"}
19 changes: 19 additions & 0 deletions .agents/pm/issues/pm-github-aplb.toon
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: pm-github-aplb
title: Closeout workflow tests race the detached telemetry flush when removing their temporary global root
description: "The 2026.10.16 release run 38867443956 failed in Run release checks: test/closeout-workflow.test.ts 'compact PR summary is privacy gated before the bot branch is published' threw ENOTEMPTY removing <tmp>/global/runtime/telemetry. The pm CLI's detached telemetry flush (upstream pm-cli#1423; follow-up #1484) can still write under PM_GLOBAL_PATH when the caller removes it. The same race hit PR #133 CI. import-gate.test.ts already retries its global-root removal (maxRetries 5, retryDelay 100); the closeout fixture did not."
type: Issue
status: in_progress
priority: 1
tags[4]: ci,fixed,flaky,tests
created_at: "2026-10-16T07:43:14.293Z"
updated_at: "2026-10-16T08:41:48.891Z"
author: claude-orchestrator
acceptance_criteria: closeout-workflow.test.ts fixture removal retries like import-gate.test.ts; Release run succeeds
expected_result: Fixture teardown tolerates a concurrent detached flush write
actual_result: Release run 38867443956 and PR #133 CI failed with ENOTEMPTY during fixture teardown
comments[2]{created_at,author,text}:
"2026-10-16T07:52:14.347Z",claude-orchestrator,"Fix: closeout-workflow.test.ts fixture teardown now retries the temp-root removal (maxRetries 10, retryDelay 100), matching import-gate.test.ts. Local CI-like run (fresh HOME, no global git config, no GH tokens, built dist): node --test test/closeout-workflow.test.ts 20/20 pass. Root cause upstream: detached telemetry flush writes under PM_GLOBAL_PATH after the CLI exits (pm-cli#1423 fixed root resurrection only; follow-up pm-cli#1484 filed)."
"2026-10-16T08:41:48.891Z",claude-orchestrator,"Review round 1 (CodeRabbit): finite rmSync retries cannot outlast a detached flush that may write up to the HTTP timeout later. Both disposable-global-root fixtures (closeout-workflow, import-gate) now set PM_TELEMETRY_INLINE_FLUSH=1 (documented test knob in pm docs/CONFIGURATION.md: flush inline instead of dispatching the detached worker; delivery unchanged). The retry stays as defensive cleanup. Local CI-like run: closeout-workflow 20/20; import-gate has 11 failures locally that reproduce on unchanged main in this host environment (baseline probe), so GitHub CI is the arbiter."
files[1]{path,scope}:
test/closeout-workflow.test.ts,project
body: ""
11 changes: 9 additions & 2 deletions test/closeout-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ async function fixture(fn: (f: { root: string; base: string; pmRoot: string; id:
const root = join(base, "caller");
const remote = join(base, "remote.git");
mkdirSync(root);
const env: NodeJS.ProcessEnv = { ...process.env, PM_AUTHOR: "fixture", PM_GLOBAL_PATH: join(base, "global"),
// PM_TELEMETRY_INLINE_FLUSH keeps the pm CLI's telemetry flush inside each command, so no detached
// worker can still be writing under the disposable global root when teardown removes it.
const env: NodeJS.ProcessEnv = { ...process.env, PM_AUTHOR: "fixture", PM_GLOBAL_PATH: join(base, "global"), PM_TELEMETRY_INLINE_FLUSH: "1",
GIT_AUTHOR_NAME: "Fixture", GIT_AUTHOR_EMAIL: "fixture@users.noreply.github.com",
GIT_COMMITTER_NAME: "Fixture", GIT_COMMITTER_EMAIL: "fixture@users.noreply.github.com" };
const git = (...args: string[]) => command(root, "git", args, env);
Expand Down Expand Up @@ -164,7 +166,12 @@ set +a
${shell(name, source)}
)`).join("\n"), root, env);
try { await fn({ root, base, pmRoot, id, env, run, git }); }
finally { await server.close(); rmSync(base, { recursive: true, force: true }); }
finally {
await server.close();
// The pm CLI's detached telemetry flush can still be writing under PM_GLOBAL_PATH/runtime/telemetry
// when the caller exits; retry the removal as import-gate.test.ts does (upstream pm-cli#1423, #1484).
rmSync(base, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

const setup = ["Require caller default branch", "Validate closeout inputs", "Validate npm project directory", "Prepare sync branch from default branch",
Expand Down
4 changes: 2 additions & 2 deletions test/import-gate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const PM_BIN = process.platform === "win32" ? "pm.cmd" : "pm";
const fixtureGlobalRoot = fs.mkdtempSync(path.join(os.tmpdir(), "pm-github-gate-global-"));
test.after(() => fs.rmSync(fixtureGlobalRoot, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }));
const PM_SPAWN_OPTS = { encoding: "utf-8" as const, shell: process.platform === "win32",
env: { ...process.env, PM_GLOBAL_PATH: fixtureGlobalRoot } };
env: { ...process.env, PM_GLOBAL_PATH: fixtureGlobalRoot, PM_TELEMETRY_INLINE_FLUSH: "1" } };
const SYNC_BRANCH = "automation/pm-github-sync";

// --- Fake-but-well-formed malicious fixtures, assembled from parts.
Expand Down Expand Up @@ -869,7 +869,7 @@ esac
`, { mode: 0o755 });
const env = { ...process.env, PATH: tools + path.delimiter + bin + path.delimiter + process.env.PATH,
GH_TOKEN: "synthetic-test-token", GITHUB_TOKEN: "synthetic-test-token", PM_AUTHOR: "codex-sol",
PM_GLOBAL_PATH: fixtureGlobalRoot, PM_PATH: path.join(root, ".agents", "pm"), REPOSITORY: "acme/widgets", CALLING_REPOSITORY: "acme/widgets",
PM_GLOBAL_PATH: fixtureGlobalRoot, PM_TELEMETRY_INLINE_FLUSH: "1", PM_PATH: path.join(root, ".agents", "pm"), REPOSITORY: "acme/widgets", CALLING_REPOSITORY: "acme/widgets",
NPM_PROJECT_PATH: root, GITHUB_WORKSPACE: root,
POST_IMPORT_SCRIPT: "changelog:full", CI_WORKFLOWS: "ci.yml",
PM_GITHUB_VERSION: "2026.10.4", DEFAULT_BRANCH: "main", SYNC_BRANCH, SYNC_LEASE: "", RUNNER_TEMP: base,
Expand Down
Loading