Files

107 lines
14 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Implementation log
## 2026-10-14 — Preparation
- Read complete current `AGENT.md`; inspected functional requirements, target specification/ADRs, editable diagram labels/relationships, as-built descriptions and original source/tests/deployment. Classified documentation authority; inventoried historical images/backups without elevating superseded structure.
- Verified original repository identity and clean status at `2117236366130775214d9fd2611984d4348f2b79`. B and target revision are `3426236c6cfcece36e94642ae84d1843288f86d5`.
- Recorded pre-existing modified `AGENT.md` and untracked `AGENTOldOutdated.md`; did not modify them.
- Created preparation documentation only in `ImplementationPlan/`: plan, inventories, SHA-256 input manifest, approval questions, provisional conformance/functional registers and this log.
- Identified .NET 10 requirement versus locally installed .NET 9, and unavailable default PostgreSQL socket. No application build/test/installer or live migration executed. No empirical energy claims.
- Approval status: pending. Implementation commits: none. No application code copied or changed. Original inputs/source remain unchanged.
After approval, each entry must record stage/story/ADR, reused source paths and original hash, changed files, necessary architectural reason, test adaptations and preserved assertions, executed commands/results, commit ID where applicable, remaining risks and approved deviations.
## 2026-10-14 — Approval and Stage 0 start
Read authoritative approval completely. Q1–Q5 resolved; Q5 overrides Ubuntu-only proposal with portable distribution-aware systemd installation. Q3 requires preserving clinical classifications and thresholds, not silently replacing unsupported labels. Q4 excludes any A database access/import. Current B HEAD at approval: `20ab461c0194b3098504eabc96e9852a61356953`; pinned source unchanged/clean. No new architecture approval needed for authorized stages.
### Stage 0 checkpoint — passed
- Downloaded official pinned .NET SDK 10.0.100 into `/tmp/healthapp-b-dotnet`; restored dependencies into `/tmp/healthapp-b-nuget`.
- Git archive copied 142 tracked reference files to `Reference/ArchitectureA`; manifest hashes in `reference-files.json`. No original repository writes.
- `dotnet build HealthApp.slnx -c Release --no-restore` in B-local reference: passed, zero warnings/errors.
- `dotnet test HealthApp.slnx -c Release --no-build --logger trx`: 299 passed, 0 failed/skipped (Profile 29; Observation 236; Deployment 34). TRX evidence in `ImplementationPlan/evidence/baseline-trx/`.
- Tests used a newly created disposable PostgreSQL 18.6 container, generated secret and random loopback port; removed after tests. No Architecture A database accessed. Container is test infrastructure only, not the application's native deployment.
- Environment: Manjaro Linux x86_64, SDK 10.0.100; package/network/socket operations required sandbox escalation. Stage 0 establishes executable behavioural evidence, not clinical validity or native systemd proof.
### Stage 1 checkpoint — passed
Single ASP.NET host, Contracts and Guidance projects; framework login/accounts/assignments and identical guidance content relocated. No business HTTP clients, service-key authentication or extra listeners. Original guidance suite: only host namespace changed; functional assertions unchanged, existing upstream traps still prove zero calls. Added framework login/generic failure/no-store/service-key rejection check. 10/10 cases passed; TRX `stage1-trx` records initial configuration timing failure followed by successful correction. Commit Stage 0: `cee98e7`.
### Stage 2 — Profile checkpoint
Profile facade/owned schema/immutable DTOs; account unique/non-null, durable atomic insert and locked updates. Shared request transaction uses repeatable-read for reads and read-committed for locked writes. Runtime DB role restricted to DML, no runtime migration. Module-owned versioned SQL migration (applied twice) implements schema lifecycle; EF Core retains data access. Original create/update tests copied with namespace adaptation only; relative Location regression fixed in production controller, not assertions. Added concurrent create/retry/restart/persistent-ticket and runtime DDL-denial tests. 29/29 cases passed. Remaining all-endpoint authorization and Observation schema checks proceed with Stage 3. Stage 1 commit `523cfbf`.
### Stage 3 checkpoint — passed
Observation module owns its private EF context/entities and versioned schema SQL; patient FK restricted, positive/category/rest checks, patient/time/original/UUID index. Typed Profile existence query inside write transaction. API resolves actual observation owner, authorizes, and uses owner-scoped read/locked patch/delete. Original patch application retained; omitted/clear semantics unchanged. Original US-04–09 suites run with one HTTP host/one DB and namespaces updated. Q1 lookup failure test uses DB outage and 503 instead of service stop/502; no-write assertion unchanged. Empty-404 regression fixed in production adapters. 138/138 tests passed including controlled two-patch row-lock barrier and orphan FK rejection; zero build warnings/errors. Private types exposed only to test assembly via InternalsVisibleTo. Stage 2 commit `bfe6ebf`.
### Stage 4 checkpoint — passed
SummaryPolicy, TrendPolicy, ClinicalPolicy and Guidance-owned versioned ReferenceCatalog extracted without changing formulas/rounding/thresholds/labels/explanations. Analytics captures one immutable series and releases the shared snapshot before calculation. All original numerical/trend tests retained, with shared namespaces and explicit catalog constructor injection; HTTP dependency failure expectations alone changed 502→503 under Q1. 207/207 tests passed, zero build warnings/errors. `src/TRENDS.md` preserves reproducible method details; `clinical-provenance.md` records unverified cautious inferences and narrative limits without altering outputs.
### Stage 5 checkpoint — passed
Overview composes typed Profile, Observation and Analytics queries; profile/latest/selected series share repeatable-read from authorization. Analytics releases capture before calculation. Deterministic interleaving commits Profile and Observation changes after Profile capture: in-flight overview stays old/coherent; next sees new values; selected query called once; transaction inactive before Analytics returns. All adopted Overview, patient and professional suites pass: 266/266 cases, zero warnings/errors. Ownership now checks route metadata before model validation to preserve denied empty-404 behaviour. Stage 4 commit `cab10c5`.
### Stage 6 checkpoint — passed
Bounded pooled DB source, configurable health/assessment admission and deadlines, cancellation/rollback, release-before-result filter, sanitized dependency errors/no-store, authenticated liveness/readiness and fail-closed remote VerifyFull requirement. Deterministic locked-write deadline leaves profile unchanged; exhausted assessment budget returns 503+Retry-After while public guidance works; DB outage readiness is 503 while guidance/login remain usable. Restored original replacement-handler same-normalized-identity own/other assertions using real B profiles rather than obsolete HTTP stub. Fresh-schema context-default test retains all original value/text/Unknown assertions, with explicit synthetic associated patient for FK and no live migration. Module conformance checks pass. 276/276 tests passed; zero warnings/errors. Stage 5 commit `cc7f871`. Native deployment verification remains pending.
### Stage 7 — portable installer checkpoint
Independent release app/provisioner/schema scripts and native systemd unit. APT/DNF/pacman adapters, local/remote persistence separation, generated protected accounts/certificates/config/keys, separate NOLOGIN migration owners and DML runtime role, explicit native lifecycle verification and no-overwrite. Tested actual Debian 12 systemd local and separate verified-TLS PostgreSQL deployment, wrong-host rejection and absence of local PostgreSQL in remote mode. Runtime 10.0.13, local PG 15.19 / remote PG 18.6; test container environments are not measurement/physical-host evidence. 283 solution tests pass (276 functional/conformance; 7 provisioning/adapter), zero warnings/errors. Final audit strengthens database constraints, records ticket issue instant, scoped local SCRAM authentication and source/content provenance; final verification follows. Stage 6 commit `f451b55`.
### Stage 8 — concluding verification
Final Release build: zero warnings/errors; final solution suites: 283 passed, 0 failed/skipped. Independent final release published to `/tmp/healthapp-b-final-release`. Both actual native Debian 12 local/remote installations passed with final scoped SCRAM provisioning, protected runtime config mode `640 root healthapp-b`, app/DB independent stop/restart, no-overwrite rejection, VerifyFull/wrong hostname rejection and no local PostgreSQL in remote mode. Native evidence summaries and reproducible test harnesses retained.
All 146 acceptance entries link concrete executable methods; clinical support is explicitly partial for six entries while deterministic output/provenance assertions pass. No unapproved architecture, numerical or clinical-output deviation. No A data access/import. Read-only input/instruction SHA-256 checks passed, all 142 pinned reference files equal original source, original Git HEAD/status unchanged. Formatting applied only to newly implemented B projects; originals preserved. Added exact single-observation extrema assertions, without relaxing originals. Final package/source/test evidence recorded in final-verification.json; source code revision recorded after commit.
Final implemented code revision: `36740d249225898df1b3be720c453b365ffb9fa7`. Subsequent verification-record commit changes evidence only; application/deployment/test source hashes match the tested revision. Original repository remains at `2117236366130775214d9fd2611984d4348f2b79` with clean status. Preserved pre-existing AGENT.md modification and AGENTOldOutdated.md are excluded from implementation commits.
## 2026-10-16 — Architecture B JMeter tooling
User authorized copying and adapting the workload tools. Copied only tracked tools/energy-jmeter and PasswordHash source from pinned read-only A revision 2117236366130775214d9fd2611984d4348f2b79, with hashes retained. Generated JMX plans are identical: public APIs are compatible. Adapted account generation for B flat/nested JSON, configuration/service instructions and architecture metadata. Added verified Python TLS compatibility for the installer certificate profile (missing AKI under Python 3.14 strict mode); CA/hostname validation retained and negative checks pass. No product code or architecture changed. Historical A calibration remains labelled; private inputs/raw results/binaries excluded. See tools/energy-jmeter/ARCHITECTURE-B.md and verification-b.json for verification scope/results. No energy/capacity conclusion.
## 2026-10-20 — owner-directed admission/failure correction
Removed new four-assessment and 32-request immediate-rejection gates and blanket
30-second deadline. Removed installer pool/admission/deadline defaults; Npgsql
default pooling or explicit connection/deployment settings apply. Preserved
request cancellation, transactional snapshots and cleanup. Restored six adopted
A dependency-outage assertions/statuses from 503 to original 502. Original A
repository remains read-only/clean at 2117236366130775214d9fd2611984d4348f2b79.
Pre-existing unrelated B changes retained. Latest owner instruction supersedes
historical Q1 permission; no architecture/input documents edited.
Final Release build: zero warnings/errors. Full disposable PostgreSQL 18.6 suite:
282 acceptance + 7 deployment = 289 passed, zero failures/skips. New deterministic
held-request regression at 5/26/40 concurrency, client-cancel/write rollback and
pool-wait cancellation/recovery tests; corrected installer test. Isolated old
implementation fails new five-request regression (expected failure evidence
retained). Published native HTTPS build: 639/639 requests passed across insights,
trends and overview with synchronized bursts at 5/26/40 concurrency, despite
legacy gate/deadline settings. A first harness attempt exposed a test-container
startup race; readiness corrected to the final TCP listener, successful rerun
retained. tools/verify-admission-correction.py reproduces native regression.
Evidence saved separately under evidence/admission-correction; historical failed
four-hour measurement and earlier stage tests were not relabelled. New package
published under /tmp/healthapp-b-admission-correction-release. Testserver still
runs the previous release pending protected deployment/restart. No claim of
universal failure equivalence or a completed new four-hour measurement.
### Fresh-install USB delivery — owner direction, 2026-10-20
Owner requires a full server reinstall for the next experiment and rejected
testserver patching. Prepared a full installer from the exact native-tested
release (app SHA-256 1f476847095b1b6b20a436a7f3c6848910f3d500af2c8b660f1f95255ae2c0ae),
including app, provisioner, migrations, dependency adapter and systemd unit.
No patch/update script included. Removed only Ventoy/HealthApp-B-2026-10-19 after
copying and verifying the new Ventoy/HealthApp-B-2026-10-20 payload. All 42 files
including manifest verified; all 20 unrelated root entries retained unchanged.
Old folder retained locally under /tmp for recovery, not on USB. USB writes synced.
Fresh-install instructions explain that reinstalling creates a new CA/accounts
and requires monitoring/comparison-fixture preparation again. Testserver software
was not patched or restarted. Fresh Ubuntu installation/new experiment pending.