Commit Graph

193 Commits

Author SHA1 Message Date
Ty e63c964844 fix(deploy): use variable for fastapi upstream in nginx-m1.conf to fix host not found at startup 2026-09-19 15:56:20 -07:00
Ty 6aaad81583 fix(deploy): restore context: .. in compose (relative to deploy/ file); remove invalid || from backend/Dockerfile; prune backend from .dockerignore so COPY succeeds 2026-09-19 15:53:49 -07:00
Ty 39ee82bdf8 fix(deploy): correct build context to . in docker-compose.yml (was .. breaking M3 build from repo root) 2026-09-19 15:52:11 -07:00
Ty 3fb35e8957 fix(deploy): proxy /api/ to fastapi in nginx-m1.conf for M3 smoke checks 2026-09-19 15:50:40 -07:00
Ty b3380f3848 feat(settings): S1 AES-GCM crypto + Settings API/UI (masked write-only secrets)
- backend/crypto.py: AES-GCM (cryptography.AESGCM); key=base64(SLAB_AES_KEY)
  must be exactly 32 bytes; value_enc=base64(nonce(12)||ct); DecryptError on tamper
- backend/settings.py: get_settings (secrets->{configured:bool}, woo_base_url env
  read-only, flags default false), update_settings (rejects woo_base_url SETTINGS-85,
  encrypts secrets, partial plain writes)
- backend/app.py: wire GET/PUT /api/v1/settings
- frontend/src/create/settings/Settings.svelte: masked form + partial PUT
- tests: crypto roundtrip/tamper, masked GET, encrypted PUT, reject woo_base_url,
  flags default, decrypt-fail->configured:false (TDD)

Verified live: secrets round-trip configured:true with valid key; woo_base_url write
rejected 400; no secret leak in GET. Gates: check_requirements + check_coverage exit 0;
pytest 13 passed. Deploy+build on ubudual5060 (never Windows).
2026-09-19 15:48:42 -07:00
Ty 0eb2b0f697 feat(backend): S0 foundation (schema + stdlib sqlite3 db factory + health/meta + JSON logs)
- backend/db/schema.sql: all 12 tables from DATA-MODEL.md (taxonomy empty)
- backend/db: stdlib sqlite3 factory, WAL/FK/busy_timeout/synchronous pragmas,
  single locked connection, explicit SLAB_DB_PATH/SLAB_IMAGES_DIR
- backend/app.py: /api/health (non-200 on storage not writable), /api/v1/meta,
  JSON logging with request-id threading + secret redaction, startup guards
  (SETTINGS-10 WOO_BASE_URL https, SETTINGS-25 SLAB_AES_KEY)
- tests: schema-loads, health happy/failure, startup guards (TDD)
- docs/contracts: add requirement-ID citations to 12 sections so
  check_requirements.py passes (pre-existing gate debt)

Gates: check_requirements.py + check_coverage.py exit 0; pytest 5 passed
2026-09-19 15:34:15 -07:00
Ty 9b181a937b docs(agents): focus AGENTS.md on agent-operational rules
The file restated facts owned by other docs and carried personal
references.

- Drop the status section, the agent-context block, the M3 scope prose, and
  the 14-bullet invariants list; each restated docs/README.md,
  docs/MILESTONES.md, or a docs/REQUIREMENTS.md row.
- Replace the ports and hosts paragraph with a pointer to docs/DEPLOYMENT.md
  and deploy/INVENTORY.md.
- Correct the subagent rule to the real constraint: one at a time on the
  single GPU. Subagents do coding work.
- Remove the name references.
- Keep the structure contract, the change-a-requirement procedure, and the
  gate commands.
2026-09-19 13:24:41 -07:00
Ty b166e796ad tools(docs): require citations in citing docs
Two checks were added to catch drift between the point of record and the
docs that cite it.

- Check 11: a capability or contract doc must declare its IDs in a
  Requirements impact table, and may cite only those.
- Check 12: a section that makes a behavior claim must cite an ID in that
  section. External-shape sections are exempt.

CAPTURE.md and CREATE.md gained the impact-table rows the first check
requires. check_coverage is unchanged.
2026-09-19 13:17:37 -07:00
Ty 2d12cbcfbd docs(m3): rewrite CONTENT-WOO for clarity
The file repeated requirement IDs on nearly every line, carried defensive
negations, mixed 'description' with 'long description', and left a cross
reference and the payload shape incomplete.

- Cite requirement IDs once in the Requirements impact table.
- Name the seven leaves as the synced WooCommerce wood-category leaves.
- Keep the length ft/in split with the short-description pattern it serves.
- Use 'description' only, matching the Woo field.
- Complete the cross references with section pointers.
- Follow the Woo v3 product shape and add an example submission whose
  taxonomy values are placeholders, since the synced cache supplies them.
2026-09-19 13:17:37 -07:00
Ty 5a210c47b0 docs(m3): reconcile the remaining docs with the settled design
Docs written before this thread still carried the three-source copy model and
the Call 2 fields it implied.

- REQUIREMENTS.md REVIEW-10: title and short description are deterministic; the
  description comes from the model or the server.
- CREATE.md: primary category declared before Call 2; deterministic copy; the
  prompt revision interface; the slug; auth row in out-of-scope.
- API.md: infer-content inputs and result are the long description only.
- UAT-PRACTICE.md: the walk no longer tells the owner to leave copy for
  templates.
- README.md: the deploy section duplicated docs/DEPLOYMENT.md and
  deploy/INVENTORY.md; it now points at them.
- DEPLOYMENT.md: the prompt seed is stated per METADATA-105.

Both gates pass.
2026-09-19 13:17:37 -07:00
Ty 35848fe0e6 Update docs/README.md 2026-09-19 19:32:15 +00:00
Ty f0f891f80e docs(m3): add the prompt revision interface, seed, and auth gap
UAT requires prompt tuning, so the iteration system is M3; only the editing
UI is deferred.

- METADATA-105 now covers storage, append-only revisions, and recording the
  revision used.
- METADATA-106 adds the REST revision interface (append, activate, read); no
  prompt UI.
- METADATA-107 records the missing authentication as a later row; there is no
  M4 yet, so the PoR carries it.
- PROMPTS.md owns the seed text as revision 0, the seed mechanism, and the
  interface; sections renumbered after inserting them.
- DATA-MODEL.md §7 cites PROMPTS.md, adds content_hash, and states the
  append-only rule.
- task_breakdown.md notes the S7 interface and the deferred auth.

155 requirements; both gates pass.
2026-09-19 12:29:08 -07:00
Ty d6aa79b593 docs(m3): regroup METADATA and remove the false fallback framing
METADATA was ordered as it was written, not by topic, and used Call 1 /
Call 2 without defining them.

- Add a short METADATA preamble stating the inference flow: Call 1 vision
  proposes taxonomy, the name and short description are deterministic, Call 2
  writes the long description.
- Regroup the rows: taxonomy, then Call 1, then deterministic copy, then
  Call 2, then cross-cutting.
- METADATA-70 said the deterministic name and short description were an
  inference-off fallback; they are unconditional. It now covers only the
  inference-off description.
- METADATA-81 folded into METADATA-80 (same rule, two strings).
- METADATA-45 now names the below-threshold outcome.
- METADATA-90 now states what the fact block drives.

153 requirements; check_requirements and check_coverage both pass.
2026-09-19 12:10:11 -07:00
Ty 120e0be871 docs(m3): settle deterministic title and Call 2 design
Encode the recovered per-leaf title/short-description rule and the Call 2
input set into the point of record.

- REQUIREMENTS.md: METADATA-55 now produces the description only; METADATA-60
  carries the ruled input set; METADATA-80 is the deterministic title; new
  METADATA-81 is the deterministic spec-line short description; METADATA-85
  selects the patterns; REVIEW-15 declares the primary before Call 2;
  PUBLISH-55 carries an explicit name+SKU slug.
- CONTENT-WOO.md: per-leaf title and short-description catalog, slot order,
  dimension placement, and the Cook Woods provenance.
- PROMPTS.md: Call 2 inputs and output; the deterministic patterns are cited,
  not restated.
- CREATE.md, WOO-API.md, MILESTONES.md, task_breakdown.md updated to match.

Modeled on Cook Woods product-title form; the seven per-leaf prose templates
and Specialty cuts are parked in the M3 breakdown.
2026-09-19 11:36:03 -07:00
Ty 1dfff0b7c9 docs(deploy): correct host addresses and port-block rules
- LAN address 192.168.1.202 for ubudual5060; port block 10880-10889; :10880 off limits.
- Release process points at the new ops runbook.
2026-09-19 10:12:32 -07:00
Ty 2ba5428269 docs(m3): place create decisions in the contracts
- DATA-MODEL.md: storage engine (stdlib sqlite3 + schema.sql, no ORM/migrations),
  pragmas, per-test isolation.
- API.md: revision coupling, async job model, PUT check order, server-derived ready.
- PROMPTS.md: no prompt files ship; the DB is the only prompt source.
2026-09-19 10:12:32 -07:00
Ty 6435199f08 docs(structure): govern .planning/ and register the ops runbook
- docs/STRUCTURE.md: add a .planning/ registry (vision/roadmap/history/breakdown
  roles), broaden the roadmap role, add enforcement items 8-10.
- tools/check_requirements.py: scan .planning/ too - every .planning/**.md must be
  registered, registered files must exist, requirement rows rejected there.
- .planning/: PROJECT.md, ROADMAP.md, MILESTONES.md, and milestones/v0.5/M3/
  {roadmap.md,task_breakdown.md}. M3 breakdown holds only the tasks; decisions live
  in the contracts.
- docs/DEPLOYMENT.md: add the ops runbook (registered as ops).
2026-09-19 10:12:32 -07:00
Ty 90e862cfb0 Revert "docs(m3): record create build plan and decisions"
This reverts commit 20f08bbc25.
2026-09-19 09:35:57 -07:00
Ty 20f08bbc25 docs(m3): record create build plan and decisions
Working record for a fresh session: settled contract rulings (R1-R4),
implementation decisions (stdlib sqlite3 + schema.sql, in-process job queue,
BLOB photo store, DB-only prompts), slice order S0-S7, guardrails. Cites
requirement IDs; defines none.
2026-09-19 09:29:02 -07:00
Ty 63a99e8154 docs(m3): close create contract gaps (soft delete, publish poll, prompts, image volume)
- R1 soft delete: add deleted_at to slabs; exclude deleted rows from GETs
- R2 publish: terminal poll returns woo_product_id then the working row is
  discarded; the app never deletes from WooCommerce (reworks PUBLISH-25)
- R3 prompts: SQLite is the point of record; file-based prompts superseded,
  compose prompt mount removed
- R4 images: photo bytes are SQLite BLOBs; /images is a health probe + staging

Details recorded in .audit/m3-build-plan.md.
2026-09-19 09:28:53 -07:00
Ty 1391219e48 docs(structure): retire Phase 2 planning sections and trim AGENTS context 2026-09-18 21:10:46 -07:00
Ty 01aa4c52c3 docs(phase2): reconcile requirements and migrate capabilities/contracts
Surface-matrix sweep of every source doc; added nine missed behaviors (METADATA-115, REVIEW-50, APP-55/60/65, SETTINGS-45 mode, Generate-text availability, defaults-off). 153 requirements, 0 coverage gaps.

Migrated capabilities to docs/capabilities/ and contracts to docs/contracts/; added WOO-API, API, DATA-MODEL, PROMPTS, UX, TEST-SPEC. Populated MILESTONES; branch-neutral trunk docs; renamed umbrella term to Woo Slab Taxonomy. Archived reconciliation working records under .audit/archive/.
2026-09-18 21:02:06 -07:00
Ty a8cc2f7596 docs(audit): sync session handoff with commit state 2026-09-18 12:54:27 -07:00
Ty 84d7681c6f docs(phase2): coverage gate, migration TODOs, session handoff
- add tools/check_coverage.py and .audit/coverage ledger (schema + settings pilot)
- add coverage gap worklist and source-doc migration TODOs
- add session handoff; redirect stale resume points in AGENTS.md, docs/README.md, reconciliation record
- add rows: CAPTURE-41, CAPTURE-141, METADATA-66, PUBLISH-31, SETTINGS-51
2026-09-18 12:54:08 -07:00
Ty 1603467747 docs(requirements): apply owner corrections; space IDs by 5
- PUBLISH: attempt-level failure wording, no image cap, failure triage rows
- METADATA: title rule is fallback-only (Call 2 not run)
- REVIEW: calculated widths/sqft/bdft not user mutable
- IDs now step by 5 per namespace; rule recorded in STRUCTURE.md
2026-09-18 11:24:41 -07:00
Ty 8ac534c613 docs(audit): add resume-here handoff for next session 2026-09-18 10:54:11 -07:00
Ty 238fcc4f15 docs(requirements): draft reconciled requirement set (128 rows, 8 namespaces)
Reconciles the scattered requirements onto the owner-job namespaces.

- docs/REQUIREMENTS.md: 128 requirements across CAPTURE, METADATA, REVIEW,
  PUBLISH, SETTINGS, APP, OPS, QUALITY
- docs/STRUCTURE.md: Test may be a path, a requirement ID, or - ;
  a shipped path must exist
- tools/check_requirements.py: resolve test refs accordingly
- .audit/2026-09-18-reconciliation-decisions.md: full decision record plus
  18 deferred rulings for the final cleanup pass

Gate: python tools/check_requirements.py -> PASS
2026-09-18 10:38:30 -07:00
Ty b42e3cb8ce docs(structure): add requirements contract, job namespaces, and enforcement gate
Phase 1 scaffold for the docs consolidation:

- docs/STRUCTURE.md: artifact registry, 8 owner-job ID namespaces, routing and change rules
- docs/REQUIREMENTS.md, docs/MILESTONES.md: normative schema, empty pending Phase 2 port
- docs/_templates/: requirement-row, capability, contract, adr
- docs/capabilities/, docs/contracts/: registered homes
- tools/check_requirements.py: enforces registry, IDs, and traceability
- AGENTS.md: coding paused banner + structure-contract routing rule
- README.md: pointers to the structure/requirements/milestones set

Additive only: no doc moves, no requirement text, no CI wiring yet.
2026-09-18 08:32:49 -07:00
grokbot_ty d754cac9ef docs(m3): bring CONTENT-WOO onto branch; lock character and categories
Copy listing-copy/Woo payload spec from main. Lock {character} to the
primary Figure term name (Cathedral example). Lock categories[] to all
ready-set species and wood-category ids.
2026-09-16 21:11:07 +00:00
grokbot_ty 40080aee3a docs(m3): lock Woo image order including dimension overlay
Calibration clean PNG is #1, dimension-overlay copy is #2, then other
inventory PNGs in capture/add order (max 5).
2026-09-16 21:07:12 +00:00
grokbot_ty eaf96d36e1 docs(m3): record open decisions blocking task breakdown
List the five locks from comparing CREATE.md to main technical docs
(categories payload, attributes shape, overlay upload, character
template source, server persistence).
2026-09-16 21:05:15 +00:00
grokbot_ty 22599c924f docs(m3): expand Create SoT for submission-ready exit
Reorganize docs for humans: README map (goals / shipped / M3), PRODUCT
overview, and a specific CREATE.md that pulls Woo sync, metadata, pricing,
and inference requirements from main. Exit criteria is a slab submission-
ready for WooCommerce, proven with a SLAB-UAT-* draft. Add UAT-PRACTICE.
2026-09-16 21:03:46 +00:00
grokbot_ty df40c4269f docs(m3): lock Create requirements on m3-ds
Add docs/CREATE.md as M3 SoT from Ty conversation (Woo attributes sync,
ready-set use, create, OpenAI Settings dependency). Point AGENTS/PRODUCT
here; mark main milestone splits obsolete for this branch.
2026-09-16 20:32:03 +00:00
grokbot_ty 03d3fcf460 fix(photos): preserve tapered tips and dark live edge (#73 #74)
Lower the axial body threshold while retaining fringe rejection, minimize length-only tip inset, and make sheet sensitivity curves testable and conservative at zero.
2026-09-16 15:18:06 +00:00
grokbot_ty 037a4b870a fix(photos): shared EXIF-oriented decode for axis/overlay space (#72)
PhotoStage used new Image() while mask worker and calculate used bare
createImageBitmap; Orientation-8 matched-set JPEGs can disagree across
those paths so the approved pink axis is not the overlay (ux,uy).

One decodeOrientedBitmap helper always requests imageOrientation
from-image (with bare fallback), wired into PhotoStage, mask.worker,
and session calculate/siblings.
2026-09-16 05:08:13 +00:00
grokbot_ty b8e69b5239 test(photos): refresh e2e evidence after tip/label fix (#71) 2026-09-16 04:55:19 +00:00
grokbot_ty 495f179c2f fix(photos): width-aware tips, stroke inset, smaller in-bounds labels (#71)
Root cause: 0.2%/99.8% axial percentiles still included dense fringe past
the visible body; round line caps and scale-tied font overshot edges and
clipped width labels. Use across-width tip stations, inset length/width
ends for stroke/arrowhead, butt caps, inventory-capped font, axis-right
length label, clamp labels to PNG.
2026-09-16 04:54:01 +00:00
grokbot_ty b386ab9670 test(photos): overlay tips on footprint + labels in-bounds (#71)
Failing UAT proofs: length span must exclude fringe whiskers past solid
body; width endpoints inset for stroke/arrowhead; smaller font; labels
clamped inside inventory PNG.
2026-09-16 04:46:48 +00:00
grokbot_ty 2be2e7d615 test(photos): refresh e2e evidence after axis parallel fix (#70) 2026-09-16 04:36:59 +00:00
grokbot_ty 6d182db81b fix(photos): length dim parallel to approved axis (#70) 2026-09-16 04:35:53 +00:00
grokbot_ty dc19cffcc0 test(photos): length/width dims follow approved axis (#70) 2026-09-16 04:35:38 +00:00
grokbot_ty 05447c92fc fix(photos): length dim snaps to wood footprint (#69) 2026-09-16 02:29:05 +00:00
grokbot_ty 415158d4d3 test(photos): length dim snaps to wood tips (#69) 2026-09-16 02:17:45 +00:00
grokbot_ty 9bc35f7edd fix(photos): overlay UAT nits + 90% crop fill (#67,#68)
Length dim already mask tip-to-tip (locked by test). Width labels move
axis-left off the wood via labelAt; font steps down to max(22, scale*1.0).
Inventory/overlay crop FILL 0.8→0.9; CAPTURE/PHOTOS docs match.
2026-09-15 21:46:58 +00:00
grokbot_ty 15895cae0c test(photos): overlay UAT nits + 90% fill expect (#67,#68)
Lock length dim to mask tip-to-tip (not oversized bbox), require width
labelAt on axis-left off the wood, smaller font contract, and 90% crop
fill extent. Red before green.
2026-09-15 21:46:27 +00:00
grokbot_ty 5650255e49 deploy: overnight M2 UAT on ubudual :10881 (#66) 2026-09-15 21:41:50 +00:00
grokbot_ty 2be400e455 test(e2e): Playwright photos-ready flow + visual evidence (#65)
Drive batch → pick calibration → Mask (Black) → Axis → Measure Calculate →
Photos ready against set1-48x2 fixtures on local vite preview. Capture
screenshots under tests/e2e/artifacts/; commit README + small evidence JPEGs.
2026-09-15 21:38:45 +00:00
grokbot_ty 2c9a50ddf9 feat(photos): Photos-ready lineup after Calculate (#64)
Add buildPhotosReadyLineup (clean cal → overlay → batch inventory PNGs
in capture order, plus empty-mask/floor error slots). MeasurePanel
switches to a Photos ready end screen with Milestone 1 numbers and the
inventory PNG lineup; Back still returns to Length axis.
2026-09-15 21:33:37 +00:00
grokbot_ty 4c3c8b49eb test(photos): Photos-ready lineup order + error slots (#64)
Failing TDD for M2 Photos-ready end screen: pure buildPhotosReadyLineup
orders clean calibration inventory PNG → dimension-overlay copy → other
batch inventory PNGs in capture order (skipping cal null), surfaces
batchApply empty-mask/floor errors, and MeasurePanel must show Photos
ready with Milestone 1 numbers (not source thumbs).
2026-09-15 21:33:00 +00:00
grokbot_ty a22525023a feat(photos): burn axis-oriented dimension overlay PNG (#63)
Add pure station/axis math and canvas burn-in for a second calibration
inventory PNG (results.overlayPng). Width stations start 6 in from the
EXIF-oriented photo bottom along the approved length axis (6, 18, … ≤
L−6); length graphic sits on axis-right outside the slab. Clean
inventoryPng and batchApply[cal]=null stay unchanged.
2026-09-15 21:31:22 +00:00