Repository navigation
test(task-bridge): structural tests for context-drop result archiving (#969) - #1192
bassilkhilo-ag2 wants to merge 1 commit into
Conversation
VasiliyRad
left a comment
There was a problem hiding this comment.
The context-drop test file (tests/task-bridge-context-drop.test.ts) is solid — source-inspection approach is correct given the inline implementation, the 13 tests cover the right properties (regex, placement in !clientConnected block, archiveFile × 2, _sendTaskStatus, _deliveredResults.add, _pendingTasks.delete), and the pure regex contract suite is a good addition.
Two bundled unrelated changes need to come out before merge:
-
src/health-check.py+tests/health-check-bridge-multi-pid.test.py— these belong to the multi-pid path-display fix (Pass 207), not the context-drop archive fix. They should go in their own PR so the test/fix pair stays together and reviewable independently. -
build_log.md— this is a workspace runtime file, not repo source. It should not be committed to the repo at all (it lives underSUTANDO_WORKSPACE, notSUTANDO_REPO_DIR). Please drop it from this branch and addbuild_log.mdto.gitignoreif it isn't there already.
Once those two are removed, this PR is ready to approve.
…sonichi#969) Companion test PR for sonichi#1189 (fix: archive context-drop results when voice client is offline). Tests will fail on main until sonichi#1189 is merged. 13 tests across 3 suites: - main.swift writeTask() emits `source: context-drop` before `task:` - task-bridge.ts result watcher has the detection regex in the offline branch, calls _sendTaskStatus/_deliveredResults/_pendingTasks, and archives both result + task file (2× archiveFile calls) - Pure regex unit tests pin the /^source:\s*context-drop/m contract: matches well-formed context-drop tasks, rejects voice/discord tasks, and rejects inline occurrences inside the task body prose Source-inspection approach (no import of task-bridge.js) avoids the node:sqlite availability constraint that affects task-bridge-format.test.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8468433 to
d95b60d
Compare
|
Rebased to single commit |
VasiliyRad
left a comment
There was a problem hiding this comment.
Companion test for PR #1189 (which I approved earlier this pass cycle). Source-inspection over both halves — Swift writeTask() emits source: context-drop, TS task-bridge.ts detects + archives. The structural-test choice (vs spinning up the bridge) is the right level here because the new logic is inline rather than exported. 1 file, no bundling.
LGTM 👍
Summary
mainuntil fix(task-bridge): archive context-drop results when voice client is offline #1189 is merged; they are designed to be merged immediately after itnode:sqliteavailability constraint that affectstask-bridge-format.test.tsWhat is tested
main.swift writeTask()(2 tests):source: context-dropheader so the TS bridge can identify the task originsource: context-dropappears beforetask:— any field aftertask:is invisible to consumers that enforce the stop-at-delimiter rule (fix(agent-api): close task-file field injection via /task body #982)task-bridge.tsresult watcher (6 tests):/^source:\s*context-drop/mdetection regex!clientConnectedblock (not outside, which would archive results even when voice is live)_sendTaskStatus,_deliveredResults.add,_pendingTasks.deletearchiveFile()calls — both the result file and the task file are archivedPure regex contract (5 tests):
source: context-dropappearing mid-line in task body prose (line-start anchor with/m)Test plan
npx tsx --test tests/task-bridge-context-drop.test.ts— all 13 pass after fix(task-bridge): archive context-drop results when voice client is offline #1189 lands🤖 Generated with Claude Code