Phase 0: stop the bleeding (rules-first pipeline, auth hardening, repo cleanup) - #5
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executes MASTER_PLAN.md Phase 0:
0.A — Trust the hot path
routes.pyno longer leaks raw exception text (last surviving research-register defect)0.B — Auth + HTTP hardening
amandla-<secret>; query tokens rejected (D9)X-Amandla-Token(D10)0.C — Noise reduction + new gates
SASL DOCUMEENTS→docs/research/sasl-sourcesSuite: 106 passed, 1 skipped.
🤖 Generated with Claude Code