Skip to content

Phase 0: stop the bleeding (rules-first pipeline, auth hardening, repo cleanup) - #5

Merged
mrlucas679 merged 5 commits into
mainfrom
claude/festive-cannon
Jul 5, 2026
Merged

Phase 0: stop the bleeding (rules-first pipeline, auth hardening, repo cleanup)#5
mrlucas679 merged 5 commits into
mainfrom
claude/festive-cannon

Conversation

@mrlucas679

Copy link
Copy Markdown
Owner

Executes MASTER_PLAN.md Phase 0:

0.A — Trust the hot path

  • Translation pipeline inverted: deterministic rules FIRST, LLM as coverage-gated assist only (D4) — 5 tests prove the order
  • routes.py no longer leaks raw exception text (last surviving research-register defect)

0.B — Auth + HTTP hardening

  • WebSocket auth via subprotocol amandla-<secret>; query tokens rejected (D9)
  • CORS middleware removed; mutating HTTP requires X-Amandla-Token (D10)
  • 10 new contract tests; preload defers connection until the secret exists

0.C — Noise reduction + new gates

  • Deleted: archive/, duplicate transformer, 281MB ASL glove dataset, duplicate PDF, tracked SQLite files
  • SASL DOCUMEENTSdocs/research/sasl-sources
  • CI +2 jobs: forbidden-pattern gate, npm production audit (0 vulns after js-yaml fix)

Suite: 106 passed, 1 skipped.

🤖 Generated with Claude Code

mrlucas679 and others added 5 commits July 5, 2026 16:06
…4, D10)

- sasl_pipeline: deterministic rules now run FIRST; the Ollama LLM is an
  optional assist consulted only when rule coverage < 0.70 and its output
  is used only when it measurably beats the rules' coverage
- routes.py: ValueError responses no longer leak str(e) internals
  (last surviving defect from the modernization research register)
- tests/test_pipeline_order.py: 5 tests proving tier order, LLM skip on
  good coverage, rejection of non-improving LLM output, and LLM-failure
  survival
- tests/test_route_errors.py: 2 tests proving generic 400/500 details

Per MASTER_PLAN.md Phase 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…al (D9, D10)

- WS auth moves to Sec-WebSocket-Protocol 'amandla-<secret>' — tokens no
  longer travel in URLs where they leak into logs; query-token attempts
  are rejected (1008); server echoes the subprotocol on accept
- preload: connect() defers until the session secret has arrived (no more
  empty-token connection attempts); passes subprotocol
- CORS middleware removed entirely: the renderer is preload-only, no
  browser origin needs CORS, and the old wildcard let any web page read
  localhost:8000 responses including the session secret
- New SessionTokenMiddleware: POST/PUT/PATCH/DELETE require
  X-Amandla-Token, blocking blind cross-origin writes from local browsers
- docs/WEBSOCKET_PROTOCOL.md, scripts (ws_test, test_all_ws_handlers,
  post_speech_test) and e2e test updated to the new contract
- tests/test_ws_auth.py: 10 contract tests (accept/reject/echo, query
  rejection, role rejection, 401 gate, CORS-header absence)

Per MASTER_PLAN.md Phase 0. Suite: 106 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deleted (per MASTER_PLAN cleanup decisions, all verified unreferenced):
- archive/ (12 stale planning docs)
- amandla_sasl_transformer2/ (archived duplicate, ARCHIVED.md said delete)
- ASL-Sensor-Dataglove-Dataset/ (281 MB ASL glove-sensor CSVs — wrong
  language, wrong modality for SASL vision work)
- SASL DOCUMEENTS/Ghaziasgar_MSC_2010 (1).pdf (hash-identical duplicate)
- delete_stale.py (purpose consumed by this cleanup)
- data/conversations.db* untracked (runtime SQLite; gitignored, local
  files preserved)

Moved: SASL DOCUMEENTS/ → docs/research/sasl-sources/ (spelling fixed;
fbx/retarget script paths updated)

CI: two new jobs — static forbidden-pattern gate (raw errors, renderer
fetch/require, query tokens, CORS return, stray load_dotenv) and npm
production audit (js-yaml vuln fixed via npm audit fix, now 0 vulns)

Also: stale ?token= comment in src/main.js fixed; e2e rejection tests
moved to subprotocol style

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…arams)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…D11)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mrlucas679
mrlucas679 merged commit bfa4e7e into main Jul 5, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant