Skip to content

Commit 325ae1b

Browse files
opencodeclaude
andcommitted
fix(test): update event-manifest wire-type tripwires; skip unrelated umask-dependent CI red
CI's unit (linux) caught two things this branch's local checks hadn't run: 1. Both packages/opencode/test/event-manifest.test.ts and packages/schema/test/event-manifest.test.ts pin exact counts of the public event manifest as a deliberate-addition tripwire. Adding the Monitor septet needed updating them: Latest.size 93->100, Durable.size 41->48, Definitions.length 93->100, ServerDefinitions.length 63->70, and the SessionV1-slice index shifted 48..51 -> 55..58 (Monitor's 7 definitions land before it in iteration order). Added explicit .has(...) checks for all 7 monitor.* wire types in the opencode-side test, matching the existing goal/ledger-quartet pattern. 2. tool.write's "sets file permissions when writing sensitive data" failed -- confirmed pre-existing and unrelated to this diff by reproducing it identically on a clean, unmodified dev clone (TKT-322, feedback anomalyco#194): the test hardcodes an 0o644 expectation that only holds under a 0022 umask, and this runner's umask is 0002. Skipped per FORK.md's established CI-reds convention, with a comment linking the feedback item and a new ledger row. Co-Authored-By: Claude <[email protected]>
1 parent 5e1a90f commit 325ae1b

4 files changed

Lines changed: 22 additions & 9 deletions

File tree

‎FORK.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ like; nothing here is a currently-live gate exception.
635635
| `packages/opencode test:httpapi`, `mode=effect` only — `v2.session.goal.get`, "a session with no goal set should report no data" | Was masked by a crash (see the `SessionGoal.node`/`SessionLedger.node` wiring gap above) until TKT-315 fixed the wiring and let the route's assertion actually run; the assertion itself then failed, a real bug in TKT-317's goal-get response path (filed as feedback #145). | **Fixed** ([#10](https://github.com/Draugur-AI/opencode/pull/10), Gemma) — confirmed dead on `dev@441ad185`: `test:httpapi --mode effect` went from 227/0 (crash-masked) to 226/1 (this assertion, post-TKT-315) to 229/0 (post-#10, three new scenarios added along the way, zero fail). No exception needed in the simplified gate above. |
636636
| `e2e (windows)`, first run only — apparent ~40 `e2e/regression/*.spec.ts` failures | **Misread, not a real symptom** — the ~40 count was a grep artifact (spec-file-path occurrences anywhere in the log, which also matches Playwright's test-discovery listing) mistaken for a failure list. The real first-run result was 2 failed / 87 passed. A subsequent run showed `e2e (linux)` — clean on its first two runs — fail 1 spec too, a *different* spec. Both platforms show the same class of ordinary, low-rate E2E flakiness, pre-existing and simply never observed before (e2e never ran on either platform pre-TKT-336, both queued forever on blacksmith). | **Not a red to resolve — moved out of the gate entirely, symmetrically on both platforms** (Ethan's ruling: stabilizing genuine Playwright flakiness is a different body of work than CI hygiene, belongs to the milestone-3 real-browser-matrix slice). See "Observational checks" above for the deterministic reading rule that replaces the skip. Feedback #156 corrected in place rather than superseded — the correction is part of its own record. |
637637
| `unit (linux)` — `plugin.openai.ws-pool`, "prunes idle websocket connections after completed responses" | Real `setTimeout`-based idle-connection-pruning race, timing-sensitive under normal host load (this host runs ~9 load average continuously serving two fleets' inference/tests — not a spike). Failed 3 times across TKT-349's own CI reruns of one unchanged commit, unrelated to that PR's diff. | **Skipped** (TKT-349, feedback #180): `test.skip` with a comment linking the feedback item. Un-skip condition: feedback #180 is triaged — fake-clock (`setSystemTime`/a controlled timer) replacing the real timer removes the flake at its root rather than just tolerating it. |
638+
| `unit (linux)` — `tool.write`, "sets file permissions when writing sensitive data" | Not timer-flaky — deterministic and umask-dependent. Asserts a hardcoded `0o644`, which only holds under a `0022` umask; this runner's actual umask is `0002`, so the write comes out `0o664` every time. Confirmed pre-existing rather than PR-caused by a stronger check than the usual "3 reruns of one commit": reproduced identically on a completely clean, unmodified `dev` clone (TKT-322, feedback #194) — no relation to that PR's diff at all, so a single occurrence was enough to conclude it. | **Skipped** (TKT-322, feedback #194): `it.instance.skip` with a comment linking the feedback item. Un-skip condition: feedback #194 is triaged — compare against `(0o666 & ~process.umask())` instead of a hardcoded mode, or set the mode explicitly. |
638639

639640
## Blacksmith runner sweep (TKT-336)
640641

‎packages/opencode/test/event-manifest.test.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ describe("public event manifest", () => {
1010
expect(EventManifest.Latest).toBe(SchemaEventManifest.Latest)
1111
expect(EventManifest.Durable).toBe(SchemaEventManifest.Durable)
1212
// 93 since session.next.lifecycle.changed joined the manifest (89), then the goal/ledger
13-
// quartet (93). This assertion exists so that adding a public wire type is a deliberate
14-
// act; update the count with the addition.
15-
expect(EventManifest.Latest.size).toBe(93)
13+
// quartet (93), then the Monitor septet -- TKT-322 (100). This assertion exists so that
14+
// adding a public wire type is a deliberate act; update the count with the addition.
15+
expect(EventManifest.Latest.size).toBe(100)
1616
expect(EventManifest.Latest.has("session.next.lifecycle.changed")).toBe(true)
1717
expect(EventManifest.Latest.has("session.next.goal.updated")).toBe(true)
1818
expect(EventManifest.Latest.has("session.next.goal.status_changed")).toBe(true)
1919
expect(EventManifest.Latest.has("session.next.ledger.added")).toBe(true)
2020
expect(EventManifest.Latest.has("session.next.ledger.superseded")).toBe(true)
21+
expect(EventManifest.Latest.has("session.next.monitor.created")).toBe(true)
22+
expect(EventManifest.Latest.has("session.next.monitor.started")).toBe(true)
23+
expect(EventManifest.Latest.has("session.next.monitor.checked")).toBe(true)
24+
expect(EventManifest.Latest.has("session.next.monitor.triggered")).toBe(true)
25+
expect(EventManifest.Latest.has("session.next.monitor.failed")).toBe(true)
26+
expect(EventManifest.Latest.has("session.next.monitor.cancelled")).toBe(true)
27+
expect(EventManifest.Latest.has("session.next.monitor.orphaned")).toBe(true)
2128
expect(EventManifest.Latest.get("session.next.step.ended")).toBe(SessionEvent.Step.Ended)
2229
expect(EventManifest.Latest.get("todo.updated")).toBe(Todo.Event.Updated)
2330
expect(EventManifest.Latest.has("ide.installed")).toBe(false)

‎packages/opencode/test/tool/write.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ describe("tool.write", () => {
173173
})
174174

175175
describe("file permissions", () => {
176-
it.instance("sets file permissions when writing sensitive data", () =>
176+
// Skipped (TKT-322, feedback #194): assumes a umask of 0022 (0o666 & ~0o022 = 0o644); this
177+
// runner's umask is 0002, so the write comes out 0o664. Reproduced identically on a clean,
178+
// unmodified dev checkout with zero relation to this PR -- not a regression from this diff.
179+
// Un-skip condition: feedback #194 is triaged -- compare against (0o666 & ~process.umask())
180+
// instead of a hardcoded mode, or set the mode explicitly rather than relying on the OS default.
181+
it.instance.skip("sets file permissions when writing sensitive data", () =>
177182
Effect.gen(function* () {
178183
const test = yield* TestInstance
179184
const filepath = path.join(test.directory, "sensitive.json")

‎packages/schema/test/event-manifest.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { WorkspaceEvent } from "../src/workspace-event"
99

1010
describe("public event manifest", () => {
1111
test("owns the complete public event surface", () => {
12-
expect(EventManifest.ServerDefinitions.length).toBe(63)
13-
expect(EventManifest.Definitions.length).toBe(93)
12+
expect(EventManifest.ServerDefinitions.length).toBe(70)
13+
expect(EventManifest.Definitions.length).toBe(100)
1414
expect(SessionV1.Event.Definitions).toEqual([
1515
SessionV1.Event.Created,
1616
SessionV1.Event.Updated,
@@ -23,8 +23,8 @@ describe("public event manifest", () => {
2323
SessionV1.Event.Diff,
2424
SessionV1.Event.Error,
2525
])
26-
expect(EventManifest.Latest.size).toBe(93)
27-
expect(EventManifest.Durable.size).toBe(41)
26+
expect(EventManifest.Latest.size).toBe(100)
27+
expect(EventManifest.Durable.size).toBe(48)
2828
})
2929

3030
test("uses canonical definitions for current public events", () => {
@@ -42,7 +42,7 @@ describe("public event manifest", () => {
4242
expect(Reference.Event.Definitions).toEqual([Reference.Event.Updated])
4343
expect(EventManifest.Latest.has("ide.installed")).toBe(false)
4444
expect(IdeEvent.Definitions).toEqual([IdeEvent.Installed])
45-
expect(EventManifest.Definitions.slice(48, 51)).toEqual([
45+
expect(EventManifest.Definitions.slice(55, 58)).toEqual([
4646
SessionV1.Event.PartDelta,
4747
SessionV1.Event.Diff,
4848
SessionV1.Event.Error,

0 commit comments

Comments
 (0)