Skip to content

Commit 9a1c148

Browse files
GiniGini
authored andcommitted
Document attachment import integrity
1 parent f79769f commit 9a1c148

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The Better Auth foundation is feature-gated by `ONEVIBE_AUTH_ENABLED=true`. It m
6363

6464
Run `npm run e2e:auth-owner` for the local auth/ownership proof. It uses a loopback mail-catcher to receive the OTP generated by Better Auth, then verifies two real session cookies, unauthenticated `401`, owner-only inventories, cross-user `404` task/project/project-file/schedule/MCP boundaries, and bounded MCP health ownership. The fixture is test delivery infrastructure only; it is not a production email or auth-bypass path.
6565

66-
The Postgres TaskStore proof additionally covers standalone-message restart recovery, atomic native-envelope/projection replay and conflict handling, transaction-backed fork history, owner-isolated MCP/org/skill operations, lease allocation/transition/restart recovery, transaction-backed workspace bytes/version restore/compare/copy, current project-file bytes/revisions, interrupted-task reconciliation, HTTP driver/read-boundary evidence, a real legacy import proof for workspace/project/native bytes and projection metadata, and a two-instance event-allocation/durable-polling proof. Postgres is now an opt-in running driver when `ONEVIBE_PERSISTENCE_DRIVER=postgres` and `DATABASE_URL` are present; authenticated owner scope is required for its data plane. The portable export intentionally excludes `inputs/` and `evidence/` paths; remaining gaps are private attachment export policy/round trips, full workflow idempotency/concurrency, HTTP authenticated multi-instance SSE acceptance, and production deployment controls.
66+
The Postgres TaskStore proof additionally covers standalone-message restart recovery, atomic native-envelope/projection replay and conflict handling, transaction-backed fork history, owner-isolated MCP/org/skill operations, lease allocation/transition/restart recovery, transaction-backed workspace bytes/version restore/compare/copy, current project-file bytes/revisions, interrupted-task reconciliation, HTTP driver/read-boundary evidence, a real legacy import proof for workspace/project/native bytes and projection metadata, attachment path/size validation, and a two-instance event-allocation/durable-polling proof. Postgres is now an opt-in running driver when `ONEVIBE_PERSISTENCE_DRIVER=postgres` and `DATABASE_URL` are present; authenticated owner scope is required for its data plane. The portable export intentionally excludes `inputs/` and `evidence/` paths; remaining gaps are private attachment export policy/round trips, full workflow idempotency/concurrency, HTTP authenticated multi-instance SSE acceptance, and production deployment controls.
6767

6868
The Postgres target contract lives in `server/db/schema.ts` and `server/db/migrations/`; run `npm run db:check` and regenerate only through the reviewed Drizzle config. `npm run db:import -- --dry-run` is the safe first inspection of legacy data; the write path requires `DATABASE_URL`, an existing Better Auth owner, and explicit owner assignment for ownerless records. `server/persistence/postgres-chat.ts`, `postgres-metadata.ts`, `postgres-operations.ts`, and `postgres-workspace.ts` plus the isolated repository E2Es prove the conversation, metadata, operational, workspace, and project-revision slices. `PostgresStateCoordinator` composes those repositories over one shared raw postgres-js client; it keeps a separate Drizzle client because Drizzle mutates date/JSON serializers during construction. `TaskStore` has an opt-in runtime path covered by `npm run e2e:postgres-taskstore`; the actual server cutover and owner-scope/read-boundary proof are covered by `npm run e2e:postgres-http`; the real legacy import is covered by `npm run e2e:postgres-import`. Remaining P4 gates are private attachment export policy/round trips, workflow idempotency/concurrency, cross-instance live SSE, and deployment migration operations. A passing schema generator, import dry-run, or isolated repository proof is not sufficient to claim production readiness.
6969

docs/IMPLEMENTATION-LOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Implementation log
22

3+
## 2026-07-17 — validate imported attachment metadata
4+
5+
- Commit `f79769f` makes the legacy importer reject dangling task attachments and size mismatches before the Postgres transaction. The E2E fixture now creates a real `TaskAttachment` descriptor, writes its bytes under the descriptor path, imports it, and verifies the bytes after restart.
6+
- Verification: `npm run lint`, `npm run check:e2e-harness`, and `DATABASE_URL=… npm run e2e:postgres-import` passed. The redacted command form is intentional; no database credentials are retained in evidence.
7+
- Boundary: import integrity is now checked for path and byte length, but the public ZIP still excludes private `inputs/` bytes and there is no full-backup archive importer. Attachment export policy/round trips remain open.
8+
39
## 2026-07-17 — harden Postgres event allocation and cross-instance live delivery
410

511
- Commit `e49e818` moves ordinary Postgres runtime-event identity into the database transaction: the transaction locks the owner conversation, allocates the next sequence, derives the canonical `${taskId}:event:${sequence}` ID, previous hash, and event hash, and ignores stale process-local identity hints from legacy callers.

docs/LINEAR-BOARD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The Postgres migration work is tracked in [ONE-254](https://linear.app/onecomput
4848

4949
The execution-path visibility slice is tracked in ONE-255: authenticated `/api/diagnostics` and the Computers panel expose bounded LiteLLM, session, persistence, runtime, sandbox, and owner-scoped MCP status/health without secrets or provider payloads. It is Done for local operational diagnostics; Postgres runtime switching, cloud health, and production sandbox attestation remain separate release gates.
5050

51-
ONE-254 progress note: commit `34a48ff` added standalone-message and atomic native-event persistence; commit `3a96539` added transaction-backed Postgres fork history with `forkHistoryAtomic=true`; commit `38407ca` added durable task bytes/version compare/restore/copy with restart recovery; `e5b5596` hardened interrupted-task/runtime-write/project-file recovery; `f115c38` added durable project revisions, the selected-driver server bootstrap, HTTP owner-scope refresh, and `e2e:postgres-http`; `c042f07` added byte-complete legacy workspace/project/native import coverage plus fresh browser evidence; `e49e818` moved ordinary Postgres event allocation into the database transaction and proved two-instance event allocation plus durable cross-instance notification. Remaining gaps are private attachment export policy/round trips, full workflow idempotency/concurrency, HTTP authenticated multi-instance SSE acceptance, and controlled production deployment.
51+
ONE-254 progress note: commit `34a48ff` added standalone-message and atomic native-event persistence; commit `3a96539` added transaction-backed Postgres fork history with `forkHistoryAtomic=true`; commit `38407ca` added durable task bytes/version compare/restore/copy with restart recovery; `e5b5596` hardened interrupted-task/runtime-write/project-file recovery; `f115c38` added durable project revisions, the selected-driver server bootstrap, HTTP owner-scope refresh, and `e2e:postgres-http`; `c042f07` added byte-complete legacy workspace/project/native import coverage plus fresh browser evidence; `e49e818` moved ordinary Postgres event allocation into the database transaction and proved two-instance event allocation plus durable cross-instance notification; `f79769f` added attachment path/byte-length validation to legacy import. Remaining gaps are private attachment export policy/round trips, full workflow idempotency/concurrency, HTTP authenticated multi-instance SSE acceptance, and controlled production deployment.
5252

5353
The focused accessibility cleanup is tracked in [ONE-256](https://linear.app/onecomputer/issue/ONE-256/uxp1-complete-accessibility-and-semantic-status-surfaces). It is Done for the local React surfaces: semantic timestamps expose `dateTime`, byte formatting is shared, and generated images have descriptive alt text. This is not a substitute for a full automated WCAG/axe audit.
5454

docs/LIVE-E2E-ENGINEERING-LOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This is the durable failure-and-evidence log for the backend POC. It records observed facts and fixes so future agents do not repeat the same experiments.
44

5+
## 2026-07-17 — attachment import integrity proof
6+
7+
- Commit `f79769f` was verified against PostgreSQL 18. The temporary legacy fixture included a real attachment descriptor (`inputs/01-private.txt`, text/plain, 13 bytes); the importer validated the path and byte count before writing, and the reopened Postgres TaskStore recovered the exact private bytes.
8+
- This closes the metadata/byte integrity check for local legacy import. It does not make the safe public ZIP reversible: private input bytes remain excluded by policy until a separate protected backup contract is designed.
9+
510
## 2026-07-17 — two-instance Postgres event/SSE proof
611

712
- Commit `e49e818` was verified against PostgreSQL 18 with two independently constructed TaskStore instances sharing one task. Concurrent writers produced distinct contiguous event sequences, canonical IDs, and a valid evidence chain after durable refresh.

0 commit comments

Comments
 (0)