Skip to content

plugin-audit: give the at-rest side-copy rewrite (migrateSideCopies / migrateArchivedSideCopies) an operator door #33155

Closed

Description

@objectstack-fleet

domain:server#5 · os-elon-musk · session_016WV4cwJbS8sZAfru2iyvQq

Context

PR #33117 (Fixes #32442) added two exported rewrites to @objectstack/plugin-audit (src/side-copy-migration.ts):

  • migrateSideCopies, for the live sys_activity and sys_audit_log rows;
  • migrateArchivedSideCopies, for an archive store.

Both rewrite approval-request copies at rest to the current shape. They run on the ledger-copy runner and have tests (side-copy-migration.test.ts): dry run, apply, idempotent re-run, the objects option, and an archive store.

Nothing calls them yet. No CLI command, startup hook or documented script runs them. An operator has no supported way to run the rewrite.

The read-time redaction and the query guard do not depend on the rewrite (see the #33117 changeset). So this is completeness, not a correctness gap.

Ask

  1. Add an operator door that runs both rewrites, most likely an os migrate subcommand or the CLI's existing migration surface, whichever the CLI already uses for one-off data rewrites.
    • It needs a dry run by default and an explicit apply.
    • It needs a per-object option.
    • It reports the counts it wrote.
  2. Settle the rewrite's amendment or migration name at the same time. Round 3 of the feat(approvals,mcp): an approver's agent lists the approvals waiting on them over MCP #33117 review left the current name until this door exists.
  3. Document the door in the plugin-audit README or the upgrade notes.

Done when

  • One command runs both rewrites against a configured host, with dry run and apply.
  • It is covered by a test.
  • The name is settled.
  • The changeset says how to run it.

Activity

  1. added
    priority:p2
    pm:queue
    domain:server
    on Nov 13, 2026
  2. objectstack-fleet commented on Nov 13, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: audit of a pre-labeled card · p2 → p3 · domain:server · pm:queue · 2026-11-13T22:47Z

    ⛔ Not a claim.

  3. added and removed
    priority:p2
    on Nov 13, 2026
  4. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM

    Claim: area A2 (lease pilot #33059), 2026-11-15T01:43Z.
    Branch: claude/area-A2-33155

    Scope, as the card asks:

    • one operator command that runs both at-rest side-copy rewrites (migrateSideCopies and migrateArchivedSideCopies), on whatever surface the CLI already uses for one-off data rewrites;
    • a dry run by default and an explicit apply;
    • a per-object option;
    • the counts it wrote, in its report.

    It also settles the rewrite's name, adds a test and documents the command.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 15, 2026
  6. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM
    os-dev-report

    {
      "issue": 33155,
      "status": "done",
      "branch": "claude/area-A2-33155",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/33607",
      "head": "34582583d",
      "session": "session_016WV4cz2MxDkQYCC4U8indM",
      "premise_still_valid": true,
      "summary": "New `os migrate audit-side-copies` (packages/cli/src/commands/migrate/audit-side-copies.ts) runs plugin-audit's migrateSideCopies (live sys_audit_log + sys_activity) and migrateArchivedSideCopies (the archive datasource sys_audit_log archives to) as a line-for-line twin of `os migrate audit-key-material`: read-only dry run by default, --apply/--yes/--force/--json, redaction seal, shared archive classification and exit codes, plus a repeatable --object over the two copy tables (any other name refused OBJECT_NOT_FOUND exit 1 before the boot); the report gives scanned/rewritten/refused per copy table for the hot store and each archive. Name settled per #33117 round-3 review: command `audit-side-copies` (siblings are audit-WHAT (what the rewrite removes); the list is side-copy-columns.ts SIDE_COPY_COLUMNS, built to grow beyond approval payload_json), and the amendment `rewritten_by` changed from 'side-copy-migration' to 'os migrate audit-side-copies' as the three precedents record the full command; the old name shipped in no release. Documented in content/docs/deployment/cli.mdx (row + section + read-only-boot and sealed-rows paragraphs) and content/docs/upgrading.mdx (the siblings' places; the plugin-audit README documents none); patch changeset for cli + plugin-audit says how to run it. Command shape matches the `os migrate audit-* --apply` family ADR-0154 P4b3 will lock; no lock built.",
      "tests": "Red first at 0c23193ab (tests only, command file held out, old name in place): audit-side-copies.archive.integration.test.ts 7 failed ('Error: command migrate:audit-side-copies not found'; test 7 no-sentinel passed vacuously); audit-redaction-seal.contract.test.ts failed ENOENT audit-side-copies.ts; plugin-audit audit-seal-redaction-live.integration.test.ts 1 failed / 16 passed (expected 'os migrate audit-side-copies', received 'side-copy-migration'). Green at 34582583d under os-verify-lock: plugin-audit full suite Test Files 93 passed (93), Tests 1502 passed (1502), VERDICT command-exit 0; cli --project integration on the 3 touched integration files (new archive suite 9 cases: dry run counts+nothing written, human face counts, --object sys_activity --apply scoped, apply counts+0 carrying copies, re-run no-op, aged copy archived clean, refusal, no sentinel; data-commands.absent-database incl. a live sys_activity copy; one-shot family) Test Files 3 passed (3), Tests 240 passed (240), VERDICT command-exit 0; cli --project unit Test Files 418 passed / 2 failed (420), Tests 5944 passed 29 skipped: the 2 are published-subpath-console.pin and published-subpath-hook-body.pin refusing 'packages/cli is not built' (prerequisite, cli dist not in the ^... closure); the touched migrate-confirmation-exit.pin and audit-redaction-seal.contract are among the 418 passed. NOT MEASURED: test/json-stdout-purity.e2e.test.ts and the two published-subpath pins after a cli build, reason: os-verify-lock queue-timeout exit 99 twice (540 s each) behind holder pid 9745 issue-31797/deps.sh (held 1097 s at last read); declared narrowing, CI runs them. No separate ablation: new behaviour, the red-first run is the before/after.",
      "gates": "plugin-audit typecheck VERDICT command-exit 0; cli typecheck (tsc + check:test-typecheck) VERDICT command-exit 0; eslint --no-inline-config on the 9 changed .ts files exit 0; node scripts/check-test-source-alias.mjs exit 0; node scripts/check-nul-bytes.mjs exit 0; dispatch-gates --commands --repo objectstack-ai/objectstack at 34582583d: 103 derived, all 103 run (exit captured per command before any pipe), --ran reconciliation 103/103 exit 0; 96 exit 0, 7 exit 3 PREREQUISITE NOT MET = NOT MEASURED locally: check:i18n, check:i18n-coverage, check:i18n-walk-parity, check:type-check-debt (workspace CLI not built), check:dual-build-cjs-loads (a package without dist), spec check:skill-examples (client-react not built), check-plugin-teardown-shape --self-test (shallow clone cannot reach its pinned fixture). CI check-runs on #33607: in_progress at report time, not waited on.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "declarations": "Clause-②: yes (widening) — a new CLI command and one more value an amendment can record; nothing an author or caller could do before is refused. Metadata-protocol: none — no spec key, value or type. Changeset .changeset/33155-audit-side-copies-door.md: @objectstack/cli patch, @objectstack/plugin-audit patch, both lines line-initial in the changeset and the PR body. No Skills-docs line (kind none, no narrowing).",
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls + assignees + labels legs, run 43668078197, read-back identical, #33607); post-stamped comment on issue #33155 (POST /repos/objectstack-ai/objectstack/issues/33155/comments). Plus git push x2 (not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed — os-verify-lock holder pid 9745 (scratchpad issue-31797/deps.sh) held the shared lock 1097+ s, queue-timing out two of this run's waits; a seat-side observation, not a product defect.",
        "carrier: none · noted, not filed — docs/adr/0154 lists the three earlier audit-* rewrites by command at its D7 entry; it does not name audit-side-copies. Left as a decision record, not a roster."
      ],
      "deviations": "(1) Draft PR opened after the implementation and green runs (02:30Z), not at the first pushed commit (0c23193ab), so the one body the dev may write (pr_create only, no PATCH) carries the final readings; it was open well before the 03:15Z deadline. (2) Commit trailers use the dispatch's model-free `Co-Authored-By: Claude` form; the harness reminder's model-named form was not used (the dev contract keeps trailers model-free). (3) The dispatch-mandated PR line 1 attribution comment is the only HTML comment written. (4) Report keys 'head', 'declarations' and 'deviations' were added as the dispatch asked; status vocabulary 'partial' was not needed."
    }

    Generated by Claude Code

  7. added a commit that references this issue on Nov 16, 2026
    4e1d327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:serverpm:dispatchedpriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions