Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 37 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [Unreleased — dependency security] — 2026-12-01 — cross-spawn production audit fix

Pinned the transitive `cross-spawn` dependency to `7.1.2` through an npm override.
A newly published advisory (GHSA-ghv9-86vm-4v8m) marks `7.0.0 - 7.0.6` as
critical for command injection on Windows; the CI production audit gate began
failing on the existing lockfile. `npm audit --omit=dev --audit-level=critical`
now reports 0 critical vulnerabilities (9 remaining: 5 high, 4 moderate, with
no non-breaking fix available for the rest). No product source behaviour
changed.

## [Unreleased — Layer A] — 2026-11-30 — staged German content generation

Owner explicitly selected A and authorised sequential work through B, C and D. Added
Expand All @@ -18,37 +28,50 @@ instruction remain owner gates. B, C and D were not started as code: no licence-
documents, no attached device and no authenticated live rail credential were observed.
Evidence: `docs/evidence/S101-A-language-content-staging.md`.

## [Unreleased — Layer B] — 2026-11-30 — RAG source import infrastructure (staged, not executed)
## [Unreleased — Layer B] — 2026-12-01 — RAG source import infrastructure corrected to the real schema (staged, not executed)

Owner-authorized sequential layer B after A. Added gate-safe RAG import
infrastructure with no content imported:

- `src/rag/documentProcessor.ts` — shared validation (API key, JWT, GitHub token,
email, phone, card-like PII detection) and deterministic chunking
(`chunk-{docId}-{sha256}`, unique IDs, sequential indices, overlap splitting)
email, phone, card-like PII detection) and deterministic chunking. Rejection
messages name the pattern only and never echo matched secret/PII material.
Chunk IDs include the chunk ordinal so repeated identical paragraphs cannot
collide.
- `scripts/rag/import-documents.mjs` — pure Node ESM import plan generator;
reads `.txt`/`.md` from `docs/rag-sources/`, validates, chunks, emits JSON plan;
requires `--license-confirmed` (fail-closed, no output without it)
- `scripts/rag/governedImporter.ts` — writes the plan through
`Database.governedWrite` to `documents` + `document_chunks`; every row stamped
`source_status: 'USER_PRIVATE'`, `provenance: 'user_imported'`, owner `user_id`,
portal type; idempotent upsert via `matchFields`; fails closed on write error
- `tests/rag/documentImport.test.ts` — adversarial tests: secret/PII rejection,
deterministic unique chunk IDs, USER_PRIVATE marking, owner/portal stamping,
idempotent upsert, fail-closed on write error, all three portal types
- `scripts/rag/governedImporter.ts` — routes the plan through the shipped
`storeChunks` ingestion path (`lib/knowledge.ts` → `Database.governedWrite`)
instead of writing invented schema columns. Document and chunk ids are
deterministic UUIDs; import metadata lives in the JSONB `metadata` column;
every row is `USER_PRIVATE`; idempotent upsert; rejects document or chunk write
failures explicitly.
- `tests/rag/documentImport.test.ts` — adversarial tests: secret/PII rejection
without echo, deterministic unique chunk IDs including repeated paragraphs,
real-schema column allowlist, UUID ids, USER_PRIVATE marking, owner/portal
stamping, idempotent upsert, fail-closed on document and chunk write errors,
all three portal types
- `docs/rag-sources/README.md` — intake rules: no documents without a written
licence/rights basis, USER_PRIVATE default, governed boundary only,
`--license-confirmed` required
- `docs/evidence/S101-B-rag-import-staging.md` — staging evidence and blocker
documentation
- `docs/evidence/S101-B-rag-import-staging.md` — corrected staging evidence,
red/green proof and blocker documentation

The first Layer B merge wrote `documents.source_status`, `document_chunks.chunk_id`
and other columns that do not exist in the committed schema; its mock accepted
arbitrary columns, so the tests passed while the real insert would fail. The
corrected test file against base `78f0b06` exited 1 with 5 failed / 20 passed
(25 tests), and the corrected tree passed 25/25. No document was imported before
or after the correction.

Layer B remains **blocked on owner input**: `docs/rag-sources/` is intentionally
empty; no licence-cleared documents, no licence/rights basis and no named human
reviewer have been supplied. No document has been imported. No OFFICIAL or
COMMUNITY claim is made. C and D were not started as code.

Suite ratchet moved by measurement from 130 files / 697 tests to 131 files / 722 tests in
`AGENTS.md` and CI. No threshold was lowered.
Suite ratchet is 131 files / 722 tests in `AGENTS.md`, CI and README. No threshold
was lowered.

## [1.18.0] — 2026-11-30 — Sprint 101 release close-out

Expand Down
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Supabase](https://img.shields.io/badge/Backend-Supabase%20%2B%20pgvector-3ECF8E?style=for-the-badge&logo=supabase&logoColor=white)](https://supabase.com)
[![Ollama](https://img.shields.io/badge/Local%20AI-Ollama-000000?style=for-the-badge&logo=ollama&logoColor=white)](https://ollama.com)
[![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org)
[![Tests](https://img.shields.io/badge/tests-697%20passing-emerald)](https://github.com/dmuhoro/easytutor)
[![Tests](https://img.shields.io/badge/tests-722%20passing-emerald)](https://github.com/dmuhoro/easytutor)
[![Constitution](https://img.shields.io/badge/constitution-Article%20I--VII-purple)](CONSTITUTION.md)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue)](LICENSE)

Expand Down Expand Up @@ -115,18 +115,23 @@ the off-palette blue is gone from the rendered quiz tree

### RAG Source Import (Layer B — staged, not executed)

Documents can be imported through the governed layer with deterministic chunk IDs.
`scripts/rag/import-documents.mjs` reads `.txt`/`.md` from `docs/rag-sources/`,
validates (no secrets, no PII, size limit), chunks deterministically and emits
an import plan. `scripts/rag/governedImporter.ts` writes that plan through
`Database.governedWrite` to `documents` + `document_chunks`, both owner-column
governed (`user_id`) and portal-scoped. Every import is `source_status:
'USER_PRIVATE'` / `provenance: 'user_imported'` by default; no OFFICIAL or
COMMUNITY claim is made. The script requires `--license-confirmed` and exits
without it (fail-closed). `tests/rag/documentImport.test.ts` covers secret/PII
rejection, deterministic unique chunk IDs, USER_PRIVATE marking, owner/portal
stamping, idempotent upsert, fail-closed on write error and all three portal
types.
The staged import path assigns deterministic UUID ids through the shipped
`storeChunks` ingestion path, but it has not been executed on any document.
`scripts/rag/import-documents.mjs` reads
`.txt`/`.md` from `docs/rag-sources/`, validates (no secrets, no PII, size
limit), chunks deterministically and emits an import plan.
`scripts/rag/governedImporter.ts` routes that plan through `storeChunks`
(`lib/knowledge.ts` → `Database.governedWrite`) to `documents` +
`document_chunks`, both owner-column governed (`user_id`) and portal-scoped.
Every import is `USER_PRIVATE` with `user_imported` metadata by default; no
OFFICIAL or COMMUNITY claim is made. Import metadata lives in the JSONB
`metadata` column; no non-schema columns are written. The script requires
`--license-confirmed` and exits without it (fail-closed). Rejection messages
name the pattern only and never echo matched secret/PII material.
`tests/rag/documentImport.test.ts` covers secret/PII rejection, deterministic
unique chunk IDs, the real schema column allowlist, UUID ids, USER_PRIVATE
marking, owner/portal stamping, idempotent upsert, fail-closed on document and
chunk write errors and all three portal types.

Layer B remains **blocked on owner input**: no licence-cleared documents have
been supplied, `docs/rag-sources/` is intentionally empty, and no import has
Expand Down Expand Up @@ -224,7 +229,7 @@ All must be green before a push:
```bash
npm run typecheck # tsc --noEmit, 0 errors
npm run lint # eslint, 0 errors
npm test # vitest, 130 files / 697 tests (real-screen route smoke, one-home tab-nav, quiz reliability, Mathematics evidence gates, M1 routing/retrieval/citation proofs, answer-source + excerpt-on-tap, wired practice/tutor route truth, German pack/review/explanation/drill path, locale coverage, desktop shell + orientation, idle-startup scheduling, C13 Socratic wiring, C37 state handlers, Lighthouse and capacity controls)
npm test # vitest, 131 files / 722 tests (real-screen route smoke, one-home tab-nav, quiz reliability, Mathematics evidence gates, M1 routing/retrieval/citation proofs, answer-source + excerpt-on-tap, wired practice/tutor route truth, German pack/review/explanation/drill path, locale coverage, desktop shell + orientation, idle-startup scheduling, C13 Socratic wiring, C37 state handlers, Lighthouse and capacity controls)
npm run test:auth-flow # live local Supabase Auth + Mailpit proof (needs local Supabase running)
npm run e2e:smoke # no-backend 390px route/PWA smoke (9 tests; also runs in CI)
npm run e2e:full # real 390px app + local Supabase (5 tests; needs local stack)
Expand Down
2 changes: 1 addition & 1 deletion STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ remote. The published tag is not moved. The owner's exact `TAG v1.18.0` instruct
| Sprint 101 production deployment | **OBSERVED READY** — `dpl_5dPmRBZnhTEfAXfuhKqPsH8Niq5y` (`485bd79`), `dpl_7L3nxSvJTSUv7YRLeUchHw97y3YK` (`71b388f`), `dpl_AYXTdqf9gCimoLEgm3VwnaDQsNPp` (`1bab683`), `dpl_FQEUFjNzYzxzqpgCugZdXTKHtwc5` (`7f21700`, the `v1.18.0` tag SHA) `dpl_2SWNsFDwWTNhFHE6W418KqfFsYMR` (`03a44ca`, first docs merge) and `dpl_4yPp4uxCMYvSBWZrABYC7rqu8Fc8` (`e4e548a`, second docs merge) are production `READY`, aliased to `easytutor-ten.vercel.app`; HTTP `200` on `/` and `/login` for earlier SHAs and on `/` for `7f21700`, `03a44ca` and `e4e548a`. No browser Lighthouse/device proof. | `docs/evidence/S101-promotion-ci-deployment.md`, `docs/evidence/S101-v1.18.0-release-closeout.md` |
| Sprint 101 owner-gated expansion triage | **NOT EXECUTED BY DESIGN** — no 100-card generation, DW/Goethe import, KINAP registration, hosted AI live call or reminder toggle was shipped. Each needs provenance, licence, human review, device or live-rail proof before a new spec-driven layer can exist. | `docs/evidence/S101-owner-task-triage.md` |
| Sprint 101 Layer A — staged German content generation | **ENGINEERING DONE, PROMOTION BLOCKED** — owner selected A. ADR-012 spec, 120-concept seed, pinned `gemma2:2b` generator and a staged `COMMUNITY`/`UNREVIEWED` 120-card candidate under `docs/evidence/`. Pinned parameters; 13/120 cards changed across runs, so model text is not claimed byte-reproducible. Fail-closed on single-token output; negative control made the test exit 1 before restore. Authoritative schema + four red controls green; drill still imports only the original 12-card pack. Daniel's accuracy review and a separate version/tag/release remain owner gates; no OFFICIAL claim. | `docs/adr/ADR-012-language-content-generation.md`, `docs/evidence/S101-A-language-content-staging.md` |
| Sprint 101 Layers B/C/D | **LAYER B INFRASTRUCTURE DONE, IMPORT BLOCKED** — B: RAG import validator, chunker and governed importer implemented (`src/rag/documentProcessor.ts`, `scripts/rag/import-documents.mjs`, `scripts/rag/governedImporter.ts`, `tests/rag/documentImport.test.ts`); all imports USER_PRIVATE by default, governed database boundary only, `--license-confirmed` required. No licence-cleared documents supplied, `docs/rag-sources/` empty, no import performed. C: no attached device or Apple team. D: no AI provider credential in local env. No simulated proof was created for any layer. | `docs/evidence/S101-B-rag-import-staging.md`, `docs/evidence/S101-A-language-content-staging.md` |
| Sprint 101 Layers B/C/D | **LAYER B ENGINEERING CORRECTED, IMPORT BLOCKED** — B: RAG validator, chunker and importer implemented (`src/rag/documentProcessor.ts`, `scripts/rag/import-documents.mjs`, `scripts/rag/governedImporter.ts`, `tests/rag/documentImport.test.ts`). The importer now routes through the shipped `storeChunks` ingestion path instead of writing invented schema columns; ids are deterministic UUIDs, import metadata lives in JSONB `metadata`, and every import is USER_PRIVATE with `--license-confirmed` required. Observed red control on base `78f0b06`: 5 failed / 20 passed; corrected tree 25/25. No licence-cleared documents supplied, `docs/rag-sources/` empty, no import performed. C: no attached device or Apple team. D: no AI provider credential in local env. No simulated proof was created for any layer. | `docs/evidence/S101-B-rag-import-staging.md`, `docs/evidence/S101-A-language-content-staging.md` |

| Sprint 101 W3 capacity model | **FAIL-CLOSED GATE RED; NO ROW PROMOTED** — `scripts/ops/capacity_model.mjs` reads versioned provenance (200 calls/user/day + 1000 tokens from `DEC-05.md`, 200,000 tokens/day from `daniel-D07.md`) and refuses to pass while D16 is unsigned. Real `--learners 100` run exits 1: demand 20,000,000/day, shortfall 19,800,000/day. Pure integer helpers proved with four fixture tests (green at 1 learner, red at 10). `capacity:check` stays out of blocking CI; `GT-18`/`E16-T1` remain UNPROMOTED. Exact ratchet strengthened to 125 files / 664 tests. | `docs/evidence/S101-capacity-model-red.md` |
| Sprint 101 W2 state coverage + mobile Lighthouse | **GATES LANDED, REAL MOBILE SCORE RED; NO ROW PROMOTED** — `tests/design/states.test.ts` maps all nine state-bearing Stitch entries to exact handlers in shipped files; a loose matcher was rejected as a false gate and the exact-match red control was observed. Mobile Lighthouse preset added with D12 floor 60 from versioned provenance and median-of-3; fixture controls green (7 tests), real local run RED (`/` 45, `/login` 45), desktop unchanged and also locally below its 80 floor (72/78). No floor lowered; the gate stays out of blocking CI. `GT-24`/`E15-T2`/`E15-T3` remain UNPROMOTED. Exact ratchet strengthened to 124 files / 660 tests. | `docs/evidence/S101-state-coverage-and-mobile-lighthouse.md` |
Expand Down
Loading
Loading