# Issue implementation plan - 2026-10-26 Repository: https://git.mchus.pro/mchus/QuoteForge Six issues (#2-#7) remain open. Their initial fixes were merged into `main` in [PR #8](https://git.mchus.pro/mchus/QuoteForge/pulls/8), with release notes in v3.50. Acceptance and remaining rule compliance work continue sequentially on `fix/issue-acceptance-and-migration-safety`. | Order | Issue | Implementation and acceptance | Status | | --- | --- | --- | --- | | 1 | [#2](https://git.mchus.pro/mchus/QuoteForge/issues/2) | Block foreign Host/Origin/Referer and cross-site browser requests in both routers; validate API body types; refuse saved-password reuse for a changed host/port/user. Middleware and real setup/runtime router tests reject attacks without changing saved credentials or user data. | Acceptance passed | | 2 | [#4](https://git.mchus.pro/mchus/QuoteForge/issues/4) | Move LOT-bearing cart/rental events to delegated listeners and escaped data attributes; escape BOM and sync output; share HTML escaping; render toast as text. Malicious LOT regression checks and headless Chrome DOM checks pass. | Acceptance passed | | 3 | [#7](https://git.mchus.pro/mchus/QuoteForge/issues/7) | Require a fresh verified archive outside rotation before reset, refuse unsynced/legacy states without explicit force, use transactional deletion, remove environment-triggered reset. Verified refusal, ZIP restore, backup failure, rollback and CLI startup after restore. | Acceptance passed | | 4 | [#5](https://git.mchus.pro/mchus/QuoteForge/issues/5) | Persist TLS mode/CA in SQLite, expose setup controls, share policy across setup/sync/migration DSNs. Verified certificate trust, hostname checks, fallback policy, settings round-trip and live MariaDB 11.8 transport. | Acceptance passed | | 5 | [#3](https://git.mchus.pro/mchus/QuoteForge/issues/3) | Keep each migration file in one session, execute verify headers before history insertion, propagate FK failures. Verify failed queries/checks never enter history. | Implemented | | 6 | [#6](https://git.mchus.pro/mchus/QuoteForge/issues/6) | Require Go 1.27.3, update vulnerable dependencies, block release on pinned govulncheck. Tests, vet, security scan, cross-platform builds and release failure checks pass. | Acceptance passed | ## Decisions - HTTP forms remain supported on setup and multipart vendor import; JSON APIs reject non-JSON bodies. CLI clients may omit browser origin headers. - CSP without inline scripts remains outside this patch; the issue lists it as optional. - Forced reset still requires a verified backup. `QFS_RESET_LOCAL_DB` is ignored, with a startup warning; only explicit CLI flags can initiate reset. - TLS defaults to `preferred` for existing-server compatibility, as requested in the issue. It permits plaintext fallback; use `verify-full` for authenticated encryption. The setup form explains this distinction. - `go 1.27.3` enforces the minimum compiler, including with `GOTOOLCHAIN=local`. A redundant `toolchain go1.27.3` is removed by Go tooling and is unnecessary. - The local ignored `.claude/skills/release/SKILL.md` was updated with the security prerequisite; the shared Makefile and release script enforce it in git. ## Validation and handoff Passed: `go test ./...`, `go vet ./...`, `node scripts/tests/html-security.cjs`, `make security-check`, shell syntax and diff checks, and CGO-free builds for macOS arm64 and Windows amd64. Govulncheck reports zero reachable vulnerabilities and one module-level advisory whose affected code is not called. Gin's transitive quic-go was explicitly raised to v0.59.1 after the first scan identified a reachable advisory in v0.59.0. The checks use temporary SQLite databases and synthetic certificates. They do not exercise a live MariaDB server or browser automation. The original implementation PR is merged. Remaining acceptance work and rule compliance are tracked below; issue state changes are separate. ## Acceptance follow-up ### Issue #2 `go test ./cmd/qfs -run TestRequestBoundaryOnApplicationRouters -count=1` exercises the production setup and runtime route constructors with temporary SQLite state. Foreign setup forms, opaque origins and rebinding hosts are rejected, text/plain JSON receives 415, and both setup handlers reject saved password reuse for a changed destination. Local reads still succeed. Saved credentials, project/configuration counts and the pending queue remain unchanged. The setup router construction was extracted without changing its routes so this regression exercises the same middleware registration as startup. ### Issue #4 `node scripts/tests/html-security-browser.cjs` passes in headless Chrome with an isolated temporary profile. It executes the actual template rendering functions in a browser DOM with controlled API responses. Both cart layouts, rental, parsed BOM, toast, pending sync errors, error history and repair errors preserve malicious strings as text. Real click/change/focus events preserve LOT values through delegated handlers; no injected elements or payload execution are observed. This is a rendering integration check, not a full application navigation test. Set `CHROME_BIN` outside macOS to select a Chrome executable. ### Issue #7 `go test ./cmd/qfs ./internal/localdb -run TestReset -count=1` covers reset safety and a subprocess executing the real `main` flag/startup path. With rotating backups disabled, the environment switch does not reset pending work, normal reset refuses it, and explicit forced reset creates a verified archive. The test restores ZIP contents and reopens the database through normal startup: connection settings and the pending queue survive. It deliberately selects `-migrate-status` with an unavailable loopback database to stop startup before HTTP/browser launch; no production database or user state is touched. ### Issue #5 `go test -tags integration ./internal/mariadb -run TestMariaDBTLSIntegration -count=1` starts its own disposable MariaDB 11.8 containers on random loopback ports, with TLS enabled and disabled, and removes both afterward. The test verifies the actual session cipher: preferred encrypts with a TLS server and falls back only with a plaintext server; required and verification modes reject plaintext. Correct trust succeeds, unrelated roots and wrong hostname fail. Certificates, private keys and database storage are temporary; no saved user DSN is used. The matching image must already exist locally (`docker pull mariadb:11.8`). Setup policy, local settings and synthetic TLS tests also pass. ### Issue #6 Go 1.27.3: `go test ./...`, `go vet ./...` and `make security-check` pass. CGO-free builds produce macOS arm64 Mach-O and Windows amd64 PE executables outside the repository. `node scripts/tests/release-security.cjs` substitutes a failing Go scanner in an isolated directory and confirms all five release build targets and `scripts/release.sh` stop before compilation or artifact creation. The scanner reports zero reachable vulnerabilities and one uncalled module-level advisory. No release is published by these acceptance checks.