Skip to content

Daily data-mcp test failing: parties-drift.db.test.mjs #314

Done

Description

@github-actions

Failed in the daily run on 2026-11-26: https://github.com/Mharbulous/probanda-dev/actions/runs/45883139937

Failing tests:

  • a v42 database whose v43 hop is refused stays usable: open_session lists its filings and reports the refusal, and the drafting filing renders from case data

Activity

  1. Mharbulous commented on Nov 26, 2026

    @Mharbulous
    Owner

    This was generated by AI during triage.

    Agent Brief

    Category: bug: a render of a drafting filing on a database held at schema v42 fails with no such table: arguments, where the test expects it to render.
    State: ready-for-agent: the cause is found, the fix is one guarded read, and a narrow red test states it.
    Location: cloud: the new test runs in the sandbox with the SQLite workaround in .claude/commands/implement-queue.md step 5; nothing needs Windows, data or a secret.

    Verification:

    • The nightly run (job test, 2026-11-26) fails test 7 of source/lawyer/mcp/test/parties-drift.db.test.mjs ("a v42 database whose v43 hop is refused stays usable...") at submissionFormsRender, with sqlite3.OperationalError: no such table: arguments. The stack runs renderWrittenArguments (src/submission/forms/render-companions.ts, the call fetchOpposingArguments(ctx.dbPath, ctx.proceeding.id)) into fetchOpposingArguments (src/submission/forms/opposing-points.ts).
    • fetchOpposingArguments reads arguments (columns side, anticipated, component, pinpoint) and argument_rebuts with no schema guard. Both exist only from schema v82 (migrations.sql: ALTER TABLE submissions RENAME TO arguments in the v82 hop; argument_rebuts created there). MIN_READABLE_SCHEMA_VERSION is 42 (src/submission/forms/bootstrap.ts), so any held database from v42 to v81 fails this render.
    • Every other render read already guards this: argumentsTable() in src/submission/forms/query.ts uses hasTable(dbPath, "arguments") from src/submission/schema-capabilities.ts and reads a held database's submissions rows as our own arguments, with no opposing side.
    • The same nightly run's held-v42-render.db.test.mjs (Daily data-mcp test failing: held-v42-render.db.test.mjs #312) fails with the same no such table: arguments error and likely shares this cause. view-pages.unit.test.mjs (Daily data-mcp test failing: view-pages.unit.test.mjs #311, a pinned Arguments-page hash) and forms-render-gap-inventory.db.test.mjs (Daily data-mcp test failing: forms-render-gap-inventory.db.test.mjs #313, open-items entries) fail on different assertions and are not covered here.
    • Reproduced in the sandbox with a new narrow test (below): red on main.

    Decisions

    • On a database without the arguments table, fetchOpposingArguments returns an empty list, so the mockup prints no "Opposing arguments" section. Reason: it matches argumentsTable(), which gives a held database no opposing side, and the section is mockup-only. Rejected: reading the legacy opposing_points table on a held database, which adds a second read path for a database the next open migrates anyway.

    Plan

    1. In fetchOpposingArguments (source/lawyer/mcp/src/submission/forms/opposing-points.ts), return [] before either query when hasTable(dbPath, "arguments") (from ../schema-capabilities.js) is false. Note the held-database behaviour in its doc comment.
    2. Add the test source/lawyer/mcp/test/opposing-arguments-held.db.test.mjs given under Red tests.
    3. Run npm run build in source/lawyer/mcp, then python scripts/build_plugin.py at the repo root, and commit source, test and the rebuilt plugins/ together. The change is a patch for lawyer.

    Scope

    May change: source/lawyer/mcp/src/submission/forms/opposing-points.ts, the new test file, and the built plugins/ folders that scripts/build_plugin.py rewrites from them. Out of bounds: schema files and migrations, the render layout of a current-schema database, and the failures of #311 and #313.

    Done when

    • cd source/lawyer/mcp && npm run build && node --test test/opposing-arguments-held.db.test.mjs passes (in the cloud, with the SQLite workaround; the fixture helper resets PYTHONPATH, so point COCLERK_PYTHON at a wrapper that adds the sitecustomize.py folder).
    • python scripts/build_plugin.py --check reports every plugin matches its source.
    • python scripts/check_plugin.py passes.

    After landing

    Red tests

    Path: source/lawyer/mcp/test/opposing-arguments-held.db.test.mjs

    // A database held below schema v82 has no `arguments` or `argument_rebuts` table: the opposing
    // arguments inventory of a render reads as none there, never a "no such table" failure.
    
    import assert from "node:assert/strict";
    import { mkdtempSync, rmSync } from "node:fs";
    import { tmpdir } from "node:os";
    import { join } from "node:path";
    import test from "node:test";
    
    const { fetchOpposingArguments } = await import("../build/submission/forms/opposing-points.js");
    const { submissionDbAt } = await import("./helpers/template-db.mjs");
    
    test("a v42 database lists no opposing arguments and reads no arguments table", (t) => {
      const dir = mkdtempSync(join(tmpdir(), "coclerk-opposing-held-"));
      t.after(() => rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 200 }));
      const dbPath = join(dir, "submission.sqlite");
      submissionDbAt(dbPath, 42);
      assert.deepEqual(fetchOpposingArguments(dbPath, 1), []);
    });

    Command: cd source/lawyer/mcp && node --test test/opposing-arguments-held.db.test.mjs

    Failing on main: assert.deepEqual(fetchOpposingArguments(dbPath, 1), []); throws OperationalError: no such table: arguments.

    The original parties-drift.db.test.mjs test 7 is unchanged, so the repo's hook refuses to run it; the nightly run's failure, quoted above, counts as its red.


    Generated by Claude Code

  2. added
    bug
    cloud
    on Nov 26, 2026
  3. self-assigned this
    on Nov 26, 2026
  4. Mharbulous commented on Nov 26, 2026

    @Mharbulous
    Owner

    Already fixed on main by 31728e8 (#312), which guards fetchOpposingArguments against a database with no arguments table, exactly as this brief's Plan step 1 asks, and released in Lawyer 0.34.3 (8e89717).

    This brief's red test, written into a worktree of origin/main at 8e89717 and built there: COCLERK_PYTHON=<sqlite 3.51 wrapper> node --test test/opposing-arguments-held.db.test.mjs passes (1 pass, 0 fail). The test file was not committed: its path is already used by #312's test, which covers the same read on a seeded v42 database.

    Left to CI: the next daily data-mcp run should pass test 7 of parties-drift.db.test.mjs.


    Generated by Claude Code

  5. added
    wontfix
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcloudready-for-agentwontfix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions