You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
De-flake the journal pending-gap and version-probe drain tests - #994
De-flakes two timing-sensitive tests in Capacitor.Cli.Daemon.Tests.Unit that failed once each on an unrelated PR (run 35034079520) and passed on rerun. The rerun was triage, not the fix.
TranscriptJournalTests.Record_never_blocks_while_the_sink_hangs — asserted PendingGap > 0 after 100 records into a 4-deep queue. The sink only hung once the file had a line, and the header lands via Open, not the sink — so on a fast runner the writer could drain enough that the final TryWrite succeeded and PendingGap fell back to 0. The sink now hangs unconditionally, parking the writer from its first append so the overflow is structural. The wall-clock bound also moves 500ms → 5s (100 TryWrites on a loaded runner are not 500ms).
DaemonRunnerVersionProbeTests.A_version_whose_output_exceeds_the_pipe_buffer_is_drained_not_deadlocked — the stub flooded 500 KB to stderr before echoing the version on stdout, on a 3s launch-probe budget. Under load the yes | head pipeline overran the budget, the child was killed before the stdout echo, and the parse fell back to the stderr flood (0123456789ABCDEFGHIJ). Flood reduced to 200 KB — still 3× the OS pipe buffer, comfortably inside the budget.
No production code changes — the probe and journal behave correctly; only the tests raced.
Verification
Both targets run 15× in isolation: 15/15 pass each.
Full Capacitor.Cli.Daemon.Tests.Unit suite: 3253 passed, 38 skipped, 1 failure (Installed_codex_schema_matches_the_vendored_pin, a known local environment pin, unrelated).
1. Committed report exposes a developer path✗ Dismissed🐞 Bug⚙ Maintainability
Description
The added fix report records the developer's local checkout path and detailed push/session history
instead of repository-maintained project information. Anyone reading the repository can see
/Users/tony/Documents/kcap-cli and unrelated PR workflow details, while future maintainers must
distinguish this artifact from actual project documentation.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
The new file identifies a prior PR and branch, then includes the absolute local checkout path
/Users/tony/Documents/kcap-cli; the file is unrelated to the two test-only changes described by
this PR.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The PR adds `.sdd-244-fix-report.md`, an unrelated historical report containing a developer-local filesystem path and detailed prior-PR/session information. This is not needed to de-flake the two tests and leaks environment-specific details into the repository.
## Fix Focus Areas
- .sdd-244-fix-report.md[1-4]
## Recommended Fix
Delete `.sdd-244-fix-report.md` from the PR. If any project-relevant rationale must be preserved, move only a concise, repository-oriented explanation into the affected test comments or the PR description, removing local paths, push logs, and unrelated historical details.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Unrelated agent guidance reaches the repository✗ Dismissed🐞 Bug⚙ Maintainability
Description
The new AGENTS.md adds repository-wide instructions and project claims unrelated to the
pending-gap and version-probe test fixes. Because agent tooling may consume this file automatically,
future automated changes can be guided by stale or out-of-scope protocol and workflow assertions
that this PR neither validates nor requires.
+The `kcap` CLI records Codex sessions by forwarding hook payloads and transcript data to a Kurrent Capacitor server. It also hosts an agent daemon for remote Codex CLI management and provides PR review context via MCP tools.++Review flows use a vendor-neutral catalog-start v2 protocol: reserved `spec-review`/`code-review`+aliases select an explicit or server-default reviewer independently of the driver. Codex setup+registers `kcap-flows` without auto-approval and tracks only newly-created global TOML entries in+`mcp-ownership-v1.json`, so uninstall preserves manual/customized MCP configuration. Daemons retain+the string unattended-vendor list for compatibility and additionally advertise structured+per-vendor CLI/launcher-policy capabilities. Cursor serves borrowed review context from a+daemon-owned snapshot (dirty tracked and non-ignored untracked files, refreshed between rounds),+because its zero-interaction modes may write; Codex borrowed-worktree review remains uncertified+and therefore fails closed to an owned worktree.
Relevance
●● Moderate
The guidance is broad and unrelated, but historical practice is mixed on accepting verbose
repository documentation.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
The added guidance describes ACP/catalog-start protocols, Cursor review snapshots, MCP ownership,
issue workflow, and AOT publishing, none of which is related to either modified test. It also
declares itself repository-wide through its root-level location and contains imperative agent
instructions.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The PR adds a broad `AGENTS.md` containing protocol, vendor, worktree, and review-flow claims unrelated to the two test changes. Repository-wide agent instructions should be introduced in a dedicated documentation change with validated guidance, not bundled into a timing-test de-flake PR.
## Fix Focus Areas
- AGENTS.md[1-17]
- AGENTS.md[54-73]
## Recommended Fix
Delete `AGENTS.md` from this PR, or split it into a separately reviewed documentation change after verifying every instruction against the current repository. Keep this PR limited to the test changes and their directly relevant comments.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Review mode: 🚀 Fast: The behavioral changes are narrowly localized to two timing-sensitive unit tests, with no production, API, security, or data-path changes; the remaining additions are documentation and repository guidance.
Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR
De-flake daemon timing tests and add repository guidance
🧪 Tests📝 Documentation🕐 20-40 Minutes
AI Description
• Make journal queue overflow deterministic by blocking every asynchronous sink append.
• Reduce version-probe flood volume while retaining pipe-buffer drain coverage.
• Add repository guidance, a prior-PR fix report, and an empty root artifact.
The following are alternative approaches to this PR:
1. Split unrelated repository artifacts
➕ Keeps the PR focused on the two flaky daemon tests
➕ Avoids publishing a stale report for another branch and PR
➕ Prevents an unexplained empty root file from entering the repository
➖ Requires removing these files or submitting repository guidance separately
Recommendation: Keep the deterministic sink and reduced flood-size test changes; they directly address the observed races while preserving coverage. Remove .sdd-244-fix-report.md and long, and move AGENTS.md to a separate documentation PR unless these additions are explicitly intended for this work.
• Reduces the POSIX stub's stderr flood from 500 KB to 200 KB so it reliably completes within the three-second probe budget. The output remains substantially larger than the pipe buffer, preserving concurrent-drain coverage.
Make pending-gap overflow structurally deterministic
• Blocks every sink append from the first invocation so the bounded journal queue cannot drain before the overflow assertion. It also raises the non-blocking wall-clock allowance from 500 milliseconds to five seconds for loaded runners.
• Adds a detailed report about conflict resolution, ACP fixes, verification results, commits, and push status for a different branch and pull request. It is unrelated to the daemon test de-flaking described by this PR.
AGENTS.mdAdd repository development guidance+73/-0
Add repository development guidance
• Documents project structure, build and test commands, PR conventions, NativeAOT precautions, and common implementation mistakes for coding agents and contributors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
De-flakes two timing-sensitive tests in
Capacitor.Cli.Daemon.Tests.Unitthat failed once each on an unrelated PR (run 35034079520) and passed on rerun. The rerun was triage, not the fix.Closes #970. Linear: AI-2843.
TranscriptJournalTests.Record_never_blocks_while_the_sink_hangs— assertedPendingGap > 0after 100 records into a 4-deep queue. The sink only hung once the file had a line, and the header lands viaOpen, not the sink — so on a fast runner the writer could drain enough that the finalTryWritesucceeded andPendingGapfell back to 0. The sink now hangs unconditionally, parking the writer from its first append so the overflow is structural. The wall-clock bound also moves 500ms → 5s (100 TryWrites on a loaded runner are not 500ms).DaemonRunnerVersionProbeTests.A_version_whose_output_exceeds_the_pipe_buffer_is_drained_not_deadlocked— the stub flooded 500 KB to stderr before echoing the version on stdout, on a 3s launch-probe budget. Under load theyes | headpipeline overran the budget, the child was killed before the stdout echo, and the parse fell back to the stderr flood (0123456789ABCDEFGHIJ). Flood reduced to 200 KB — still 3× the OS pipe buffer, comfortably inside the budget.Where to look
test/Capacitor.Cli.Daemon.Tests.Unit/Services/TranscriptJournalTests.cstest/Capacitor.Cli.Daemon.Tests.Unit/DaemonRunnerVersionProbeTests.csNo production code changes — the probe and journal behave correctly; only the tests raced.
Verification
Capacitor.Cli.Daemon.Tests.Unitsuite: 3253 passed, 38 skipped, 1 failure (Installed_codex_schema_matches_the_vendored_pin, a known local environment pin, unrelated).dotnet buildclean, 0 warnings.