Commit Graph
61 Commits
Author SHA1 Message Date
bchanot 36316cf67f fix(domain): sheet.check reads its document without an intermediate copy; RUST.md states the copy behaviour exactly
Second security pass on e49009e: PASS with two LOW items, both applied.
Module 1,044,559 B raw / 340,154 B gzip; core 135, core-wasm 25, app 313.
2026-10-14 01:07:17 +02:00
bchanot e49009e363 fix(domain): security audit follow-ups — deserialise JSON by reference, literal delete paths in the wasm build
The security gate (PASS, 0 blocking) reported LOW items: an imported
attachment's Value was copied for the wrapper and the snapshot gate (a
hostile 16 MiB attachment multiplied linear memory), and wasm-build.sh
deleted its outputs through a variable. Every JSON input is now read with
T::deserialize(&Value) (same errors, no copy); one deserialiser instead of
two also shrinks the shipped module from 1,180,281 to 1,046,498 bytes raw
(372,132 → 340,929 gzip). The two outputs are removed on their literal
paths. RUST.md records the numbers, the quarantine retention and the
base-image tag residual.
2026-10-14 01:02:30 +02:00
bchanot 8e8c58efca docs(docs): R2 — RUST.md §8 (migrated components, operations, runtime, census, proofs, measurements, behaviour differences, risks), CLAUDE.md, DEPLOY.md (CSP before an R2 image, never built on the VPS), WORKSPACE, TEST_STRATEGY, packages README, CHANGELOG 2026-10-14 00:51:44 +02:00
bchanot e633169a00 fix(workspace): LAN exposure via host firewall — the Supabase CLI forces 0.0.0.0, so PostgreSQL / Studio / raw Mailpit close by UFW rules on the LAN interface; gateway reduced to Mailpit behind basic auth on 54325
Owner run: the CLI prints 'All services bind to 0.0.0.0' and ignored the
rootless daemon's default address; the gateway could not share 54321/54324
with 0.0.0.0 listeners. Now: Kong serves the API directly; the DEV gateway
serves only Mailpit with basic auth on <DEV host>:54325; ENVIRONMENTS.md §3
gives the exact UFW rules (interface-scoped deny on 54322-54324, two cases
by current UFW state), rollback and impact; dev:net-check proves the
allowed surfaces from a distinct Docker network (5/5 OK) and prints the
refusal checks to run from another device, since a rootless container's
traffic to the host is delivered locally and cannot see the LAN firewall.
LRN-053 corrects LRN-052.
2026-10-13 23:01:19 +02:00
bchanot 3e48b0d848 chore(workspace): DEV least-privilege exposure — nginx DEV gateway (API on the LAN, Mailpit behind basic auth), network check from a distinct origin, loopback default for the rootless daemon documented
The Supabase CLI publishes 54321-54324 on every interface with no bind
option. Design: the rootless daemon binds published ports on loopback by
default (~/.config/docker/daemon.json {"ip":"127.0.0.1"}, owner action,
not applied), and the DEV gateway (Compose service dev-gateway, profile
dev, container faunosteo_dev_gateway) re-publishes only the API (Kong) and
Mailpit behind HTTP basic auth on FAUNOSTEO_DEV_HOST; Studio and PostgreSQL
stay loopback (SSH tunnel for Studio). pnpm dev:gateway generates the Mailpit
credentials (gitignored; htpasswd 644 because the rootless container user
cannot read a 600 file, hash only). pnpm dev:net-check probes from a
throwaway container on its own Docker network: app, API health, REST 401,
Mailpit 401/200, PostgreSQL and Studio closed. Gateway proven on alternate
ports (health 200, password login 200, Mailpit 401 / 200).
2026-10-13 22:38:40 +02:00
bchanot dd4c35c061 chore(workspace): DEV origin on the private network — scripts/dev-env.sh (FAUNOSTEO_DEV_HOST detected or set), Supabase CLI wrapper, pnpm dev on the LAN address, config.toml URLs via env(); ENVIRONMENTS.md (identity Faunosteo / faunosteo.com, DEV / STAGING / PROD, exposure table, owner procedure)
The owner tests from other devices of the private network: every test
surface is addressed by the machine's LAN address, never 127.0.0.1 or
localhost, never hard-coded. scripts/dev-env.sh decides the host once
(hostname -I, FAUNOSTEO_DEV_HOST override, production hosts refused);
scripts/supabase.sh exports it for every CLI call (pnpm db:*, pnpm supabase)
because config.toml now reads api.external_url (mail links), auth.site_url
and studio.api_url with env(); scripts/dev.sh = pnpm dev on that origin,
pnpm dev:offline keeps the local tool alone; dev-lan.sh removed.
Verified: GoTrue API_EXTERNAL_URL and Studio SUPABASE_PUBLIC_URL on the LAN
address, a signup mail linking to http://<lan>:54321/auth/v1/verify, the
four published ports answering from a separate Docker network, and the
10-step procedure in headless Chromium at the LAN origin with every request
URL audited (no 127.0.0.1 / localhost).
2026-10-13 22:06:25 +02:00
bchanot 40ae453f84 chore(supabase): ceiling comments aligned, prefix patterns built once, cross-account residuals named in STORAGE.md 2026-10-13 20:20:19 +02:00
bchanot 6a9657ce1e fix(supabase): per-account byte budget at begin (64 MiB of bytes present), pending claims charged at the cap, unsized objects ignored in the pending term, partial index on pending claims
Fourth audit (PASS, residual MEDIUM): one account could hold real bytes
during the grace with no bound. begin_avatar_upload now refuses rate_limited
when the caller's objects under its two prefixes plus one cap exceed
private.account_byte_budget(); pending claims count one 5 MiB cap each
(the declared size is not enforced by the upload); an object without a size
does not cancel its claim. pgTAP (plan 140): landed upload charged once by
its bytes, per-account budget refusal. STORAGE.md names the residuals
(colluding accounts at their budget, filesystem quota) and the musl ndots
detail.
2026-10-13 20:15:18 +02:00
bchanot 273914d825 fix(supabase): ceiling measured on bytes present in the bucket plus pending claims without bytes; confirm fails closed on an unsized object; cleartext host must start with a letter
Third audit (BLOCK 1): counting terminal rows while queued let begin spam
pin the ceiling with declared sizes. The ceiling now sums storage.objects
sizes of the bucket (whatever the row's state) plus the declared size of
pending_upload rows whose quarantine object has not landed: a claim dies
with its row, a present object counts whatever its row says, no full scan of
the assets history. confirm_asset_upload treats an object without a size as
upload_missing. pgTAP (plan 138): rejected rows without bytes weigh nothing,
pending claims fill, superseded claims vanish, present bytes fill, unsized
object refused. Worker: a single-label cleartext host must start with an
ASCII letter (0X… hex forms refused, test added); STORAGE.md names the
native-run search-domain residual.
2026-10-13 20:07:22 +02:00
bchanot c386a08b0b fix(supabase): second security pass — ceiling counts queued purges, confirm refuses more than declared, upload predicate needs an active account; worker cleartext host check strict
Re-audit findings: the ceiling now also counts terminal rows whose keys still
wait in the purge queue (contract wording kept honest, residual named);
confirm_asset_upload refuses an object larger than the declared size;
can_upload_avatar_object joins profiles.active; pgTAP covers the null
sha256 guard on a live lease, the three service_role revocations, the
queued-purge accounting and the deactivated-account upload (plan 137).
Worker: cleartext http only for localhost, a dotted-quad loopback address or
a non-numeric single-label name (numeric and hex hosts refused, tests added).
2026-10-13 19:58:54 +02:00
bchanot cd2dbb3b79 fix(supabase): security pass on the files foundation — ceiling counts live bytes only, confirm checks the account, null sha256 refused, browser RPCs one role; worker: cleartext only on loopback or a service name, no env proxy, key ownership cross-check, no library text in logs
Security audit (PASS, 2 MEDIUM + LOW): the global ceiling summed every
non-deleted row, so rejected uploads ratcheted it toward storage_full with no
disk used → in-flight rows by declared size, clean rows by byte_size, nothing
else (pgTAP: rejected rows do not count, in-flight rows do); confirm refuses a
deactivated account like begin; complete_avatar_job refuses a null sha256;
begin / confirm / remove granted to authenticated only. Worker: SUPABASE_URL
over http:// accepted only for loopback or a single-label Docker service
name; ureq proxy(None); the job's keys must embed its owner and asset ids;
backend_failure / claim_failed / sweep_failure lines carry the closed kind and
the HTTP status, never the library's error text. e2e: uuid shape checked
before the psql query. Contract revision 2 (oracle fixes).
2026-10-13 19:49:58 +02:00
bchanot 62eb4e5d82 docs(docs): Step 8 / R1 — files foundation, worker loop, avatar: CLAUDE, DEPLOY (.env.worker, CSP), SUPABASE, RUST, TEST_STRATEGY, WORKSPACE, IDENTITY §5, design README, plan as-built note, CHANGELOG; R1 plan and verifier contract 2026-10-13 19:39:52 +02:00
bchanot 0c6053c174 feat(workspace): real-stack avatar e2e, compose worker service, STORAGE.md contract
packages/supabase/tests/e2e/avatar-flow.e2e.ts (pnpm e2e:avatar through
scripts/avatar-e2e.sh: worker container on the Supabase network, 5 s sweep,
no quarantine grace; a fresh account per run): clean upload and owner-only
download (Bob, anon, quarantine key, direct final-key write refused),
replacement purged after the grace (queue clock shifted through psql), late
bytes through a still-valid signed upload URL swept, hostile and corrupted
uploads rejected with closed codes, removal with the purge queue drained.
Worker: the Storage API answers a missing object with HTTP 400 and
statusCode 404; normalised to 404 so a purge of a never-written key is acked.
docker-compose.yml: service worker under the worker profile (read-only,
cap_drop ALL, no-new-privileges, 512m, 1 cpu, 64 pids, .env.worker, external
Supabase network). docs/development/STORAGE.md: the implementation contract.
2026-10-13 19:39:51 +02:00
bchanot 496f54990a fix(ci): types drift gate fails closed on a git error and sees untracked files whatever the git config
The ci.yml step assigns git status to a variable before testing it (a git
failure now fails the step, as scripts/check-all.sh already did); both gates
pass --untracked-files=all; the rust-check.sh comment names the real gate.
2026-10-13 10:09:15 +02:00
bchanot 073b25e52b docs(docs): gate stages (drift, advisories), native exposure note, CI target wording, check:all in WORKSPACE and TEST_STRATEGY 2026-10-13 09:46:07 +02:00
bchanot 6e2bbec4b0 docs(docs): Ubuntu native development, Docker for services and isolation, separate VPS; pnpm check:all; CI status
RUST.md §1 (three environments, native install recipe, what stays in Docker
and why), §4 (pre-merge gate, workflow files prepared and never run), §5.8
(native run numbers against the builder image), §6; CLAUDE.md stack row,
commands, map, workflow rule; README quick start and verification; DEPLOY.md
CI status; WORKSPACE.md; TEST_STRATEGY.md; CHANGELOG; review Annex C.1
addendum of 2026-10-13.
2026-10-13 01:19:15 +02:00
bchanot 3af2861be7 fix(worker): iCCP-bomb proof asserts the content-rejection property (either content code); docs(docs): RUST.md worker and release workflow wording after the second security pass 2026-10-13 00:37:33 +02:00
bchanot 11813f5560 fix(worker): security audit of R0 — no core dumps, tkill/tgkill limited to SIGABRT on self, mmap without PROT_EXEC, Broken outcome for a broken child environment, frame vs canvas check, unsafe denied with local allows, sandbox tests and derivation on the release profile (syscall marker); wasm proof exports behind a feature; ci: release-images hardened (typed input via env, advisories gate, ephemeral builder, env secrets + logout, ref gate, pinned checkout) 2026-10-13 00:18:53 +02:00
bchanot 9d3e0294e2 docs(docs): RUST.md with the R0 proofs, DEPLOY image deploy by digest + CSP note, workspace/test strategy/packages/CLAUDE.md, CHANGELOG; chore(memory): TODO R0 2026-10-13 00:01:27 +02:00
bchanot 40d416b497 docs(docs): Rust review Annex C — owner validation and amendments (D-R4, D-R5, D-R9, D-R13), R0 go; chore(memory): BDR-045 2026-10-12 23:28:07 +02:00
bchanot 51667788e5 docs(docs): Rust review annexes — expanded decision table D-R1..D-R14 and R0 scope (Docker builder toolchain, 7 experimental proofs); chore(memory): BDR-044 orientation validated, journal, TODO R0 2026-10-12 22:58:09 +02:00
bchanot 3fbf34f663 docs(docs): Rust review rev 2 — 61 challenger findings folded (3 crates, frozen oracles, consumer-driven deletion, keyless parent, CSP/digest deploy); CLAUDE.md Rust-by-default rule; chore(memory): BDR-043, LRN-048, EVAL-016, journal, TODO Rust roadmap 2026-10-12 22:48:48 +02:00
bchanot 6a078dab74 docs(docs): Rust-by-default architecture review rev 1 — inventory, hidden contracts, A/B/C classification, Rust worker, workspace, roadmap R0–R6, 14 owner decisions 2026-10-12 22:21:49 +02:00
bchanot aae0b392f8 docs(docs): Step 8 analysis rev 2 — 47 challenger findings folded (keyless decode child, write order, purge queue + grace, download under RLS, narrowed schema); chore(memory): TODO 8.x 2026-10-12 01:29:57 +02:00
bchanot 54df4d851a docs(docs): Step 8 files foundation analysis — storage model, worker, quarantine, policies, backups, scope 2026-10-12 01:11:28 +02:00
bchanot 3cf74fd255 docs(docs): validated Step 7 mockups under docs/design (reference README with deltas and owning steps); chore(memory): BDR-042, journal, TODO 7.10 follow-ups — Step 7 validated 2026-10-12 00:54:03 +02:00
bchanot 9771d997f4 fix(app): failed sign-out reported (local session still cleared); reauthentication_needed phrased; docs(docs): exact production redirect allowlist 2026-10-11 23:45:14 +02:00
bchanot 552733b4c8 docs(docs): IDENTITY.md (routes, session, providers, MFA gap, manual validation); CLAUDE.md map + architecture; SUPABASE.md wiring; CHANGELOG; plan note; Step 7 verify contract 2026-10-11 23:39:08 +02:00
bchanot 62b2b9d86a fix(pdf): candidates sorted by data offset, JSON depth pre-scan before parse, budget wording; chore(memory): BLK-009 mitigated with gate, EVAL-014, journal, TODO, CLAUDE.md import notes 2026-10-11 17:31:07 +02:00
bchanot 3a6e92625a fix(pdf): inflater fed in 16 KiB slices (browser memory bound), shared 16 MiB candidate budget, monotonic bounded endstream search, JSON object pre-check 2026-10-11 17:08:56 +02:00
bchanot 6adc38b027 docs: hardening §4 commit pointer 2026-10-11 16:42:46 +02:00
bchanot 60ee71208f fix(pdf): bounded attachment extraction by byte scan — no pdf-lib parse on import, export without object streams (BLK-009) 2026-10-11 16:42:45 +02:00
bchanot 5ed4a4b620 docs: PDF import hardening analysis (BLK-009) — byte-scan reader and object-stream-free export now, worker and parser replacement before external users 2026-10-11 16:12:22 +02:00
bchanot 9e681232cf docs: step 6 sync — README layout and docs list, WORKSPACE package rule, DEPLOY rollback note, CHANGELOG entry 2026-10-11 13:11:44 +02:00
bchanot 4c6c5151f8 docs: step 6 implementation contract (types, envelope v1, read, rebase, session, messages, goldens) + BDR-039 2026-10-11 11:59:08 +02:00
bchanot 81342009fe docs: step 6 autonomous PDF archives analysis and plan (snapshot content, envelope v1, compatibility, limits, tests) 2026-10-10 23:17:23 +02:00
bchanot 17a6d9b323 test(app): former PDF, observation card, route and schema assertions restored on v3; foreign JSON attachment reported as no_attachment; doc counts 2026-10-10 12:21:19 +02:00
bchanot 09d8b01a54 fix(app): editor route split into dialogs and pickers components, canvas without lint suppression, findings picker coverage restored; golden test pins every generated draft file; stale doc lines 2026-10-10 11:55:57 +02:00
bchanot 0476276a8f docs(chore): step 5 — annotation rendering contract, CLAUDE.md map and conventions, README, DEPLOY SHEET_BUNDLE, PDF format v3, spec §6 migration map, plan/changelog/strategy notes; BDR-038, LRN-043, TODO 2026-10-10 11:41:55 +02:00
bchanot 734c0d91fd docs: step 5 migration analysis (report v3, adapter + migration map, sheet provider, annotation layer, service/store split, risks, tests, decisions D1–D8); TODO plan; plan note 2026-10-10 10:54:04 +02:00
bchanot 866e84f75b docs(chore): step 4c validated — head view check, migration limit BLK-008, review semantics, .env.example expected change, BDR-037, TODO follow-up 2026-10-10 10:32:57 +02:00
bchanot c0c17fcf5f feat(supabase): SQL gate reports non-http(s) reference urls (reference.url.scheme), pgTAP 008 cases; EVAL-010, journal, TODO 4c 2026-10-10 10:10:45 +02:00
bchanot 34be7e23df docs: schema v2 migration listed, one cleaned asset in the draft, curation file list; CHG-021 rationale names no uncited author 2026-10-10 10:05:29 +02:00
bchanot 6034909674 fix(anatomy): B/C changes leave every touched finding and annotation at to_confirm (applier rule, reviewed refused), typed test reads, docs numbers 2026-10-10 09:03:00 +02:00
bchanot c8ebcde913 docs: step 4c curation layout, review drawings, plan and changelog entries 2026-10-10 01:53:11 +02:00
bchanot 6870d87910 feat(anatomy): curation pipeline — changeset schema, applier with before/after records, cleaned single asset, draft seed, changelog + review report generators; seed layout legacy-import/curation/draft 2026-10-09 16:50:08 +02:00
bchanot 3dbbfdf1df feat(domain): sheet document schema v2 — references registry, review_status, vertebral count_range; SQL gate + pgTAP 008 2026-10-09 16:30:58 +02:00
bchanot 6c5b2b7754 chore(docker): faunosteo_ naming convention for Docker resources (compose project + container), documented CLI limit 2026-10-09 16:26:06 +02:00
bchanot dee4ce43d9 fix(supabase): confirmed uploads gate asset reads (hash claim), seeds-listed test, Dockerfile workspace manifests; importer declares every authored label, real in=out control 2026-10-09 00:50:36 +02:00
bchanot 52bfc11553 feat(domain): equine legacy importer (packages/anatomy) + generated official equine sheet seed as draft 2026-10-09 00:38:48 +02:00