Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
620 changes: 620 additions & 0 deletions .hermes/plans/2026-05-28-release-grade-hardening.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions 06_PHASE_PROMPTS/PHASE_00_PREFLIGHT_AND_BASELINE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Phase 00 — Preflight and Baseline

Run the preflight commands from the master prompt. Produce `codex/receipts/startup_preflight.json` and `codex/reports/phase_00_report.md`.

Acceptance:
- current repo root identified;
- git state recorded;
- tool availability recorded;
- current run truth surfaces inventoried;
- known build/test commands listed;
- no edits made before report.

Stop if repo root or package scope is ambiguous.
15 changes: 15 additions & 0 deletions 06_PHASE_PROMPTS/PHASE_01_CHAT_STREAM_TERMINATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Phase 01 — Chat Stream Termination

Fix the core chat infinite-response bug.

Tasks:
1. Inspect `src-tauri/src/commands/chat/mod.rs` and provider stream code.
2. Terminate on provider `done=true`, not HTTP EOF.
3. Emit exactly one terminal event.
4. Preserve final-frame metadata.
5. Add done-without-EOF test.

Acceptance:
- mock stream with `done=true` and no EOF completes within one second;
- receipt records `done_frame_seen=true`, `terminal_cause=provider_done_frame`, `eof_seen=false`;
- frontend leaves streaming state.
13 changes: 13 additions & 0 deletions 06_PHASE_PROMPTS/PHASE_02_PARTIAL_PERSISTENCE_AND_CANCELLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Phase 02 — Partial Persistence and Cancellation

Tasks:
1. Add generation attempt/lifecycle persistence.
2. Persist partial content on timeout/error/cancel.
3. Make `stop_chat` backend-authoritative.
4. Remove frontend-local durable assistant creation on stop.
5. Add continuation lineage.

Acceptance:
- token then idle timeout creates persisted partial + receipt;
- stop creates one backend-sourced cancelled assistant state;
- continuation links to partial attempt.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Phase 03 — Runtime Gates and Background Preemption

Tasks:
1. Audit GPU/LLM gate owners and background summary jobs.
2. Foreground chat must preempt/cancel/degrade background LLM work.
3. Add gate-owner/status receipts.
4. Add UI phase state for waiting/provider-starting/streaming/stale.

Acceptance:
- blocked background summary cannot make chat appear infinite;
- chat starts or reports clear bounded status within SLO;
- all gate waits are receipted.
13 changes: 13 additions & 0 deletions 06_PHASE_PROMPTS/PHASE_04_VALIDATION_GATE_HARDENING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Phase 04 — Validation Gate Hardening

Tasks:
1. Fix package scope gate.
2. Include/rename missing secret-store permissions gate.
3. Add subgate timeouts to release candidate gate.
4. Fail release gate on `release_blocker=true`.
5. Strengthen static chat audits.

Acceptance:
- every gate emits structured JSON;
- aggregate release gate never hangs;
- current known blockers fail gates until fixed.
13 changes: 13 additions & 0 deletions 06_PHASE_PROMPTS/PHASE_05_PACKAGE_RUN_TRUTH_AND_TRANSFERABILITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Phase 05 — Package, Run Truth, Transferability

Tasks:
1. Add single RunTruthV1 source.
2. Add PackManifestV1 inside package root.
3. Add GitStateReceiptV1 and ToolAvailabilityReceiptV1.
4. Separate Codex context package from release/source package.
5. Preserve required receipts and sanitized evidence summaries.

Acceptance:
- fresh unzip package gate passes;
- no run truth drift across CURRENT_RUN, sidecars, final handoff;
- package contains no unrelated root docs in release mode.
13 changes: 13 additions & 0 deletions 06_PHASE_PROMPTS/PHASE_06_RELEASE_PROOF_DESKTOP_INSTALLER_TQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Phase 06 — Release Proof

Tasks:
1. Run Rust fmt/check/test/clippy.
2. Run npm install/build/test.
3. Run live or mock Ollama chat smoke, including done-frame proof.
4. Run live desktop smoke or mark release blocked.
5. Produce semantic-memory and TurboQuant runtime receipts.
6. Run installer smoke or demote installer claims.

Acceptance:
- no S0/S1 proof gap remains;
- every unavailable live check is explicitly a release blocker or non-goal.
12 changes: 12 additions & 0 deletions 06_PHASE_PROMPTS/PHASE_07_FINAL_AUDIT_AND_CLAIM_BOUNDARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Phase 07 — Final Audit and Claim Boundary

Tasks:
1. Generate release proof packet.
2. Generate public claim diff.
3. Generate remaining delta.
4. Run all final validation commands.
5. Populate hostile auditor handoff.

Acceptance:
- final handoff includes changed files, commands, pass/fail/skip reasons, blockers, risks, rollback;
- no release/public claim contradicts receipts.
119 changes: 31 additions & 88 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,103 +1,46 @@
# AGENTS.md — Gloss Release-Proof Repair
# AGENTS.md — Gloss Closing Pass Rules

## Project
Active run: `GLOSS_TOTAL_COMPLETION_AND_HARDENING_SUPERPASS_20260526`

Gloss is a local-first Tauri + React + Rust notebook/RAG desktop app. The current task is a release-proof repair pass, not a feature expansion.
## Project purpose

## Current run
Gloss is a local-first notebook/RAG/chat application. Chat must work without retrieval when retrieval/source state is degraded. Retrieval, semantic-memory, TurboQuant, and release claims must be proof-bearing.

`GLOSS_RELEASE_PROOF_EMBEDDING_UNIFICATION_CLEANUP_20260525`
## Source-of-truth ownership

Write all run receipts/reports under:
- Frontend chat lifecycle: `src/stores/chatStore.ts`, `src/components/chat/ChatPanel.tsx`, `src/App.tsx` event forwarding.
- Backend chat lifecycle: `src-tauri/src/commands/chat/mod.rs`.
- Provider validation and model registry: `src-tauri/src/providers/*`, settings commands, settings UI.
- Source/retrieval selection: `src/stores/sourceStore.ts`, retrieval backend modules.
- Package/release proof: `scripts/`, `validation/`, `docs/codex-runs/*`, package sidecars.

```text
docs/codex-runs/GLOSS_RELEASE_PROOF_EMBEDDING_UNIFICATION_CLEANUP_20260525/
```

Historical run material is evidence only. It must not act as active instruction.

## Source hierarchy

1. Current repo source files, manifests, tests, receipts, and screenshots.
2. Current run bundle under `docs/codex-runs/GLOSS_RELEASE_PROOF_EMBEDDING_UNIFICATION_CLEANUP_20260525/`.
3. Existing product docs only when consistent with current source.
4. Historical Codex run docs only as evidence, never as active instruction.
5. README claims are not proof.

## Hard rules

- Do not add broad features.
- Do not weaken or bypass release gates.
- Do not claim release readiness without live receipts.
- Do not leave old pass artifacts active at repo root.
- Do not keep P31/P32/P33/P34/P35/P36 instructions as active guidance.
- Do not silently fallback from semantic-memory/TurboQuant to local retrieval.
- Do not keep native dense embeddings and semantic-memory embeddings as uncoordinated source-of-truth paths.
- Do not report pending queue items as running work.
- Do not report folder import complete unless terminal receipts count ready, failed, skipped, and cancelled states.
- Do not make vector indexes, caches, UI state, or generated docs source of truth.
## Forbidden behavior

## Canonical owners

| Concept | Owner |
|---|---|
| Product app workflow | `Gloss/src-tauri/src/*`, `Gloss/src/*` |
| Native dense indexing | `src-tauri/src/ingestion/embed.rs`, `src-tauri/src/state.rs`, notebook DB chunk embedding fields |
| semantic-memory projection/search | `Libraries/semantic-memory`, with app adapter in `src-tauri/src/memory/semantic_memory_adapter.rs` |
| Embedding provider boundary | Must be a single app-level provider abstraction used by native dense and semantic-memory projection |
| TurboQuant candidate artifacts | `Libraries/semantic-memory` + `Libraries/turbo-quant`; Gloss only routes/configures/receipts |
| Release proof | `docs/codex-runs/GLOSS_RELEASE_PROOF_EMBEDDING_UNIFICATION_CLEANUP_20260525/FINAL_RECEIPT.json` and validation scripts |
| Active Codex instruction | This `AGENTS.md` + current run prompts only |

## Required final artifacts

```text
docs/codex-runs/GLOSS_RELEASE_PROOF_EMBEDDING_UNIFICATION_CLEANUP_20260525/
STARTUP_PREFLIGHT.md
STALE_PASS_CLEANUP_MANIFEST.json
CHANGED_FILES.txt
COMMANDS_RUN.log
VALIDATION_RESULTS.md
EMBEDDING_PROVIDER_RECEIPT.json
EMBEDDING_DIAGNOSTICS_RECEIPT.json
DENSE_INDEXING_RECEIPT.json
SEMANTIC_MEMORY_PROJECTION_RECEIPT.json
TURBOQUANT_RUNTIME_RECEIPT.json
LIVE_DESKTOP_SMOKE_RECEIPT.json
PACKAGE_WARNING_REVIEW.md
PUBLIC_CLAIM_DIFF.md
FINAL_AUDITOR_HANDOFF.md
FINAL_RECEIPT.json
REMAINING_DELTA.md
ROLLBACK_PLAN.md
```
- Do not hide provider errors behind a spinner.
- Do not block no-retrieval chat because source list loading/partial/error.
- Do not emit `chat:done` before assistant persistence succeeds unless explicit partial/cancel artifact is emitted.
- Do not silently allow LAN or cloud endpoints; provider authority must be explicit.
- Do not claim semantic-memory/TurboQuant/dense indexing proof from dependencies alone.
- Do not add compatibility shims or shadow truth stores.
- Do not update release docs by hand if gate JSON says failed.

## Required validation

Run and record results for:
Run targeted tests first, then full gates:

```bash
npm run build
node scripts/run_frontend_contract_tests.mjs
python3 scripts/check_gloss_sm_tq_fix.py .
python3 scripts/gloss_current_run_truth_gate.py --repo .
python3 scripts/gloss_receipt_integrity_gate.py --repo .
python3 scripts/gloss_feature_matrix_gate.py --repo .
python3 scripts/gloss_issue_ledger_gate.py --ledger ISSUE_LEDGER.csv
python3 scripts/gloss_static_runtime_truth_gate.py --repo .
python3 scripts/audit_tauri_security.py .
python3 scripts/audit_ui_disclosure_a11y.py .
python3 scripts/gloss_evidence_ui_gate.py --repo .
python3 scripts/gloss_retrieval_gate.py --repo .
python3 scripts/gloss_validator_path_gate.py --repo .
python3 validation/gloss_stale_pass_surface_gate.py --repo .
python3 validation/gloss_embedding_provider_gate.py --repo .
python3 validation/gloss_live_receipt_gate.py --repo . --run-id GLOSS_RELEASE_PROOF_EMBEDDING_UNIFICATION_CLEANUP_20260525
python3 validation/gloss_next_release_gate.py --repo . --run-id GLOSS_RELEASE_PROOF_EMBEDDING_UNIFICATION_CLEANUP_20260525
cargo fmt --manifest-path src-tauri/Cargo.toml -- --check
cargo test --manifest-path src-tauri/Cargo.toml --features semantic-memory-turbo-quant
cargo clippy --manifest-path src-tauri/Cargo.toml --features semantic-memory-turbo-quant --all-targets -- -D warnings
npm run tauri:build:release
npm test
cargo fmt --all -- --check
cargo test --manifest-path src-tauri/Cargo.toml --features semantic-memory-turbo-quant commands::chat::tests
cargo test --manifest-path src-tauri/Cargo.toml --features semantic-memory-turbo-quant providers::tests
python3 validation/validate_source_send_gate.py .
python3 validation/validate_frontend_event_routing.py .
python3 validation/validate_chat_terminal_contract.py .
python3 validation/validate_provider_lan_policy.py .
python3 validation/validate_release_receipt_consistency.py .
```

Skipped checks require exact reason and must be listed in `FINAL_RECEIPT.json`.
## Completion rule

Receipts or it did not happen. Final answer must include hostile-auditor handoff.
Loading
Loading