{"v":[{"id":2863,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/205#issuecomment-2863","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/205","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"**Progress, 2026-10-25: step 2 (the redactor) is built** \u2014 commit 0d77910.\n\n## `fax\/redact.py`\nRuns on the box where the faxes are; nothing leaves it.\n\n- **Pages that aren't a recognised 2101\/2067 are dropped**, never redacted. A cover sheet has no template to say where the name is.\n- **The transport banner** across the top is filled.\n- **Layer 1**: each template field marked `\"phi\": true` (new key in `fax\/templates\/*_roi.json`) is blacked out whole, plus any OCR'd word spilling past one. The 2067 also gains `redact_regions` for the Response section's To\/From, which has no field. A page that can't be registered gets 12pt padding instead of 3pt, and the report says so.\n- **Layer 2**: Presidio (spaCy `en_core_web_lg`, on-prem) plus our own recognizers over everything else. The recognizers cover ID numbers of 7+ digits, phone numbers, BJN\/license-style ids, contract names, a labelled date of birth, and email. `DATE_TIME` is not requested.\n- **Kept**: dates, units, codes, RUG, 2060 score, check marks and the printed form.\n- **The output is image-only**: rasterised and filled, no text layer, no metadata. Named `{forms}_{sha12}.pdf`.\n- **Leftover check**: every output page is OCR'd again. If any value Layer 1 read, or any Layer 2 hit, can still be read, the fax is refused and nothing is written. Words printed on the blank forms (`printed_words`, hand-checked) never count as survivors.\n- **The report** (JSON on stdout) carries counts, entity types and field keys only. It never carries values or the input path, so it can be shared.\n\nTests: `fax\/test_redact_rules.py` (pure, standalone) has 56 checks. `fax\/test_redact.py` has 34 end-to-end checks on synthetic faxes built from the blank forms with invented values, in clean, shifted+rotated and stretched variants. No invented identifier survives in any variant, and the dates stay readable.\n\n### To run it on the secure box\n```\nvenv\/bin\/pip install -r fax\/requirements.txt -r fax\/requirements-redact.txt\nvenv\/bin\/python -m spacy download en_core_web_lg\nvenv\/bin\/python fax\/redact.py \/path\/*.pdf --out-dir \/path\/redacted > report.jsonl\n```\n`requirements-redact.txt` pins `preshed<3.0.13`, because 3.0.14 breaks spaCy's tokenizer on load. A person still pages through each sample before it is copied to `fax\/corpus\/` on dev, which is gitignored.\n\n## Claude is kept off PHI by a hook\n`.claude\/settings.json` adds Read deny rules and a `PreToolUse` hook, `.claude\/hooks\/phi-guard.py`, with 52 tests. It refuses any tool call that names any of these:\n- `faxes\/`, `fax\/output\/` or `fax\/corpus\/`\n- `downloads\/`, `hhstore\/` or `docstore\/`\n- `.env*`\n- the directories `.env` sets for the fax and document pipelines\n- Tesseract's `\/tmp` crops\n- the fax review screens\n\nIt is a seatbelt, not a sandbox: a script that opens files itself is not seen. The OS sandbox (`sandbox.filesystem.denyRead`) is not enabled yet.\n\n## Found for step 4 (calibration), not fixed\n- The classifier can't read \"Form 2101\" on the binarised blank 2101 scan (\"FOFM Z1Ut\"). `ExampleFax.pdf` reads fine.\n- A 0.8\u00b0 rotation made it miss a 2067; deskew read \u22121.97\u00b0 on one run. A 0.5\u00b0 rotation lost 2101 registration.\n- The redactor drops pages it can't recognise. That is safe, but each dropped page is one fewer sample, so the step 4 perturbation test matters.\n\n**Next:** step 1 (faxes flowing on prod) and step 3 (run the redactor, check, copy 30\u201350 per form to dev).","assets":[],"created_at":"2026-10-25T11:37:41-05:00","updated_at":"2026-10-25T11:37:41-05:00"},{"id":2864,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/200#issuecomment-2864","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/200","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"I went through every list in the 13 live form definitions (`docs\/forms\/*.json`).\n\n## Where things stand\n\nThe customer can already edit four lists on **Admin \u2192 Answer Lists** (#183):\n\n| List | Used on |\n|---|---|\n| Allergies | Client Information Sheet |\n| Equipment and assistive devices | PAS Service Plan |\n| Authority of the person signing for the client | PAS\/PHC consent, PCS consent, Private Pay agreement |\n| Languages (a menu beside \"Other (specify)\", #158) | Client Information Sheet |\n\n**No other pick-from-a-list question can be opened up as it stands.** Only a list printed on one line can take a new choice. Every other list (payer, classification, advance directives, Type of ISP, other services, the 3040's S\/U\/N\/A, and so on) has its own tick box printed on the paper. A new choice would have no box to print in. Editing one of those means changing the paper itself, not editing a list.\n\n## Where more lists can come from: a menu beside a text box\n\nThat leaves the #158 kind of list: a menu next to a typed answer. Picking from the menu fills in the wording, and the answer is still printed as typed, so it fits any line on any form. These questions are typed today and would benefit, best first:\n\n1. **Emergency contact relationship.** Client Information Sheet (first and second contact) and the Emergency\/Disaster form. The first contact is already one Shared Answer across those two forms, so the second contact would be the only extra work. This is the most common thing typed, and it's the same set of words every time.\n2. **H2076 \"describe your authority to act for the client.\"** This is a text box, while the three consents ask the same thing as a pick list. If we give it the **existing** signer-authority list as a menu, one edit on Answer Lists reaches all four forms.\n3. **Health plan (MCO) name** on both consents (\"Which health plan?\"). A short, stable list of the Texas MCOs. *Alternative:* fill it in from the VESTA authorization's payer instead. When that's available, it beats a list. Worth deciding before building either.\n4. **Reason the client cannot sign.** One Shared Answer across the three consents. Short common reasons, for example \"physical impairment\" or \"cognitive impairment\".\n\n**Not recommended:**\n- **Diagnosis.** It's a clinical free-text field, and a menu would mostly invite picking the nearest wrong entry.\n- **Service tasks \/ \"Other task.\"** These are fixed from VESTA (`auth.service_tasks`).\n- **County.** It comes from the address.\n- **Physician \/ pharmacy \/ other agency.** The provider directory lookup (#82) covers these.\n\n## Questions for the customer\n\n- Which of 1\u20134 do they want?\n- Do they have their own wording for **relationships**? The signer-authority list is still the starting list we wrote (19 Oct), not theirs, so this is a good moment to collect both.\n- For the health plan: a list they keep, or filled in from VESTA?\n\nEach one is a definition change (`\"menu\": [...]` on the field, plus a title in `ANSWER_LIST_TITLES`) and a publish. No screen or schema work is needed.","assets":[],"created_at":"2026-10-25T13:43:43-05:00","updated_at":"2026-10-25T13:43:43-05:00"},{"id":2868,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/176#issuecomment-2868","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/176","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"Fixed in a6ac68f (committed on dev, not yet deployed).\n\n- [x] `user_in_system($fk_system)` on the posted agency; a refusal is audited (`authz.denied`, `reason: not_in_system`).\n- [x] `report_type` must match `^[a-z][a-z0-9_-]{0,39}$`. `accept_column_signature()` already changes nothing unless that row exists for the system, so the shape check mainly keeps arbitrary text out of the audit record.\n- [x] Grepped every `perms[$x]` lookup in `backend\/`, `pages\/`, `code\/`. None other takes `$x` from the request: each uses `$SITE['pk_system']` (the URL's agency, which `cw_route()` already membership-checks), or filters `$_SESSION['user']['systems']` first (`pipeline-status`, `activity_scope_systems()`, `mobileTokenRegister`).\n\nAlso: the endpoint now reads `$_POST` and is gated by `check_auth_json(['role\/Administrator', 'role\/Superuser'])` instead of a bare `check_auth_json()`. It was removed from the self-scoped allowlist in `scripts\/test-backend-auth-guards.php`, which passes.\n\nNot tested live: every admin on dev is linked to all three agencies, so the refusal path is covered by reading the code, not by a request.","assets":[],"created_at":"2026-10-25T16:17:58-05:00","updated_at":"2026-10-25T16:17:58-05:00"},{"id":2869,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/178#issuecomment-2869","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/178","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"Code half done in a6ac68f (committed on dev, not yet deployed). **Leaving this open for the Caddyfile check.**\n\n- [x] One helper, `client_ip()` in `code\/client_ip.inc.php`, now used in all six places: `accountLogin`, `accountAuth`, `mobileSessionStart`, `actionPlan`, `sessions.ip`, and the audit log. It returns `REMOTE_ADDR`, and reads `X-Forwarded-For` only when `REMOTE_ADDR` is in the new `TRUSTED_PROXIES` setting (comma-separated addresses or CIDR ranges, IPv4 and IPv6). It then walks the header right to left, past our own proxies, and stops at a malformed entry. **Unset by default, so the header is never read.**\n- [x] `scripts\/test-client-ip.php` (25 checks) covers the resolver, and fails if anything else in `backend\/`, `code\/`, `pages\/` or `web\/` reads the header.\n- [x] Same commit, a #179 item: the `logs` row's `INET_ATON(\"{$_SERVER['REMOTE_ADDR']}\")` is now quoted via `PDO::quote()`.\n\n**Still to do:**\n- [ ] Check the production Caddyfile. If Caddy serves PHP directly (`php_fastcgi`), leave `TRUSTED_PROXIES` unset: `REMOTE_ADDR` is already the real client. Only if another proxy sits in front of Caddy should its address go in `TRUSTED_PROXIES`. In that case also confirm that Caddy's `trusted_proxies` is set, so it does not pass a client-supplied header through.","assets":[],"created_at":"2026-10-25T16:17:58-05:00","updated_at":"2026-10-25T16:17:58-05:00"},{"id":2871,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/29#issuecomment-2871","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/29","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"Built in a6ac68f (committed on dev, not yet deployed). Verified in one place, as the issue asked: `cw_route()`, after `check_auth()` and before any page or `\/do\/` endpoint is dispatched.\n\n## Two layers\n1. **Origin, on every non-GET request, signed in or not.** Refused when `Sec-Fetch-Site` is `cross-site` or `same-site`. Browsers that don't send it are judged by `Origin` against the request's Host instead. A request with neither header is not a browser acting for someone (a browser always sends `Origin` on a cross-site POST). It passes to whatever else authenticates it, which covers `actionPlan`'s own token. This layer also covers the anonymous endpoints: a cross-site POST to `accountLogin` would otherwise sign the victim out.\n2. **Token, on every write with a signed-in cookie session.** A per-session random value (`$_SESSION['csrf_token']`), printed as `<meta name=\"csrf-token\">` and by `csrf_field()`, and sent back as the `X-CSRF-Token` header or a `_csrf` field.\n\nA Bearer request is exempt from both, because the credential is not ambient.\n\n## Callers\n- jQuery: an `ajaxPrefilter` in the layout adds the header to same-origin requests only.\n- The six `fetch()` `post()` helpers send `window.CSRF_TOKEN`: `visit-v2`, `visits-v2`, `form-v2-releases`, `form-explorer`, `form-v2-publish`, `form-packets`.\n- The 13 POST forms print `csrf_field()`: `roles` \u00d74, `emergency` \u00d73, `login` \u00d72, `emergencies`, `users-edit`, `systems-edit`, `answer-list-edit`.\n\n## What a refusal looks like\n- On a `\/do\/` endpoint: `error_code: 'csrf'`, \"This page is out of date. Reload the page and try again.\"\n- On a page: a notice, and a 303 back to the same page.\n- Either way it is audited as `audit_security('csrf.refused')`.\n\n## Tests\n- Pure rules in `code\/csrf_rules.inc.php`. `scripts\/test-csrf.php` (43 checks) also fails on:\n  - a POST form without `csrf_field()`;\n  - a writing `fetch()` without the header;\n  - the check placed after `check_auth()` is missing, or moved below a page or `\/do\/` include.\n- I removed a token on purpose to confirm the scan fails.\n- On dev with curl:\n  - no token, a wrong token, or `Sec-Fetch-Site: cross-site` \/ a foreign `Origin` with a valid token were all refused;\n  - a valid token was accepted;\n  - GETs were unaffected;\n  - an anonymous cross-site POST to `accountLogin` was refused.\n- In Chrome: a jQuery `$.post` and the page's `fetch()` helper both succeeded without being told about the token, and a bare `fetch()` was refused.\n\n## Deploy notes\n- Browser tabs left open from before the deploy have no token, so their first save shows the message once. A visit with unsaved answers stops saving and keeps them pending, but reloading the page loses them.\n- If a person's server session is replaced while a page is open (for example, the trusted-device cookie signs them back in), the page's token is stale and they see the same message. Not seen in testing.\n- `code\/php-csrf.php` is still unused. It can be deleted separately.","assets":[],"created_at":"2026-10-25T16:17:58-05:00","updated_at":"2026-10-25T16:17:58-05:00"},{"id":2898,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/206#issuecomment-2898","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/206","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"## Decided (2026-11-03, later)\n\n- [x] **If an update changes a value of an accepted form, the form goes back to \"Not checked\".** A change to a value that staff corrected does not do this, because the correction wins.\n- [x] **Fax images go in the encrypted document store under a new subject kind, `fax`.** An unrouted fax is filed under agency 0. Only the `fax` subject kind may do this. When staff route the fax, production files the images again under the agency and archives the agency-0 copies.\n- [x] **No faxes on production yet.** Start clean. The fax push is the only route, and the worker no longer writes to a database.\n\n## Progress (not committed yet)\n\n- **Step 1 \u2014 built.** `docs\/Fax.md` describes the route. On the secure box: `fax-worker.php` \u2192 outbox \u2192 `fax-push.php`. On production: `web\/ingest.php` spools the push and `fax-intake.php` files it. New tables: `fax_form`, `fax_field_correction`, `fax_form_match` and `fax_push`. The document store has the `fax` subject kind. The image endpoint writes a PHI audit record. Tests: `test-fax-push-rules.php` (64 passed), `test-fax-intake-state.php` (49 passed). The signed push was also tested end to end on dev.\n- **Step 2 \u2014 built.** Each authorization has a VESTA date in `hh_auth_change`. The loader records it at each load. Test: `test-auth-change-rules.php` (42 passed).\n- **Step 3 (the tables) \u2014 partly done.** The form, match and push-history tables are in migration `20261103-03_fax-push.sql`.\n- **Next:** step 4, the automatic match and the retry after each VESTA load.","assets":[],"created_at":"2026-11-03T16:41:53-06:00","updated_at":"2026-11-03T16:41:53-06:00"},{"id":2899,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/197#issuecomment-2899","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/197","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"## Settled, 5 Nov (Charles)\n\n**1. The \"Ask: \u2026\" line** now sits at the top of each question's \u24d8 panel, above the list of forms the answer goes on. It's no longer under the label. A question that has an \"Ask:\" but goes on no form still gets the \u24d8 button. FormsV2Plan \u00a74.1.3 and `docs\/form-v2-interviews\/README.md` say so.\n\n**2. Fragment labels** (\"Phone\", \"Which directives\", \"Reviewed and acknowledged\"): covered for now by point 1. The \"Ask:\" line that explains them is one tap away, in the \u24d8 panel.\n\n**3. The four labels**, now pinned in `FORM_V2_STANDARD_WORDING` so a form added later can't change them:\n- Phone \u2192 **\"Phone\"** (was \"Telephone No.\")\n- Address \u2192 **\"Individual's Address\"**, kept\n- Emergency priority class \u2192 **\"What category describes your special needs?\"**, kept\n- Physician \u2192 **\"Name of Physician Individual Sees Regularly\"**, kept\n\nThe \u24d8 panel change is live in dev. The \"Phone\" label goes out with the next SOC\/AO release (not yet published). Tests: `test-form-v2.php`.","assets":[],"created_at":"2026-11-05T08:12:27-06:00","updated_at":"2026-11-05T08:12:27-06:00"},{"id":2900,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/198#issuecomment-2900","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/198","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"## Fixed, 5 Nov (Charles: \"print N\/A. clear type when attendant name is removed\")\n\n**What happens now:** clearing an attendant's name clears that attendant's visit type. Items 4 and 5 then print **N\/A** for them, unasked.\n\n**How:**\n- A question may now carry `clear_when_hidden: true`. When a save hides it, the same save clears its kept answer. The cleared row is marked as coming from the hiding (origin `hidden`), and the page is told so it updates. Code: `form_v2_visit_hidden_clears()` (pure), called from `form_v2_visit_save()`.\n- The answer is cleared **only when a save hides the question**. An attendant slot that was never named keeps its starting AO, so \"Add an attendant\" still starts as AO.\n- SOC\/AO's three attendant visit-type questions carry it. Items 4 and 5 are now `fixed_if` the type is AO **or blank** (`[\"ao\", \"\"]`; a cleared answer reads as `\"\"`).\n- This doesn't change how conditions read hidden answers in general. Every other hidden answer is still kept until signing (#120).\n\n**One difference:** an attendant who is removed and then added back starts with a **blank** type, not AO. It's required, so the supervisor picks it.\n\n**Tests:**\n- `test-form-v2-visit-rules.php`: the rule itself.\n- `test-form-v2-visit-state.php`: real saves. The save that hides the question clears the answer, and the answer stays cleared when the question comes back.\n- `test-form-v2-workflow.php`: the flag is carried from the interview file.\n\nThe publish dry run for SOC\/AO passes. This goes out with the next SOC\/AO release (not yet published).","assets":[],"created_at":"2026-11-05T08:12:27-06:00","updated_at":"2026-11-05T08:12:27-06:00"},{"id":2902,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/156#issuecomment-2902","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/156","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"## Update, 5 Nov: the AR interview is written\n\n**SOC\/AO cleanup:** the Client Information Sheet's \"Type of Visit Completed\" is no longer asked. It's fixed as Start of Care.\n\n**`docs\/form-v2-interviews\/AR.json`** is AR's interview: 277 questions in 10 steps. It's built from SOC\/AO's for the forms the two share (consent, Client Information Sheet, Emergency\/Disaster, 3040, service plan, Coordination of Care), with these changes:\n- The visit type is fixed as **Annual Reassessment**, on the Client Information Sheet and in the 3040's item 1 sentence (`visit.visit_kind` = `ar`).\n- Each attendant's 3040 visit type **starts as SV**: at a reassessment the attendant is usually already working, so this is a supervisory visit. AO and SA are still available.\n- The 3040's orientation questions (item 10) are asked only when an attendant is AO.\n- The Task Guide, Things You May Not Do, 2-1-1, transfer and Private Pay steps are gone, since AR doesn't include those forms.\n\nThe publish dry run passes every check, including the printed sample forms. It isn't published. In dev, the interview draft `AR_V2` exists.\n\n### What it showed\n\n| | |\n|---|---|\n| Offering fewer of a form's choices | **Not needed for AR.** |\n| Showing an answer that is fixed (never asked) | **Not needed for AR.** |\n| **Printing only some pages of a form** | \u274c **A gap.** The AR checklist lists only page 1 of the 3040. V2 ignores a packet's `require: pages` and prints the whole form, so an AR visit would print the 3040's orientation page with its signature lines. **Being built next.** |\n\n### Still open\n- **For Jane:** is the attendant visit type at an AR always SV? (This is question 3 above, for AR.)\n- **For the customer:** combined visits (the 20 Oct comment).","assets":[],"created_at":"2026-11-05T08:12:27-06:00","updated_at":"2026-11-05T08:12:27-06:00"},{"id":2903,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/156#issuecomment-2903","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/156","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"## Fixed, 5 Nov: a visit type prints only the pages it requires\n\n**What changed:** a packet item's `require` (`{\"pages\":[1]}` or `{\"sections\":[\u2026]}`) now narrows the form in V2. This is done wherever V2 loads a visit type's forms:\n- `form_v2_workflow_validation_ctx()`: the seed and the publish check, Shared Answers included.\n- `form_v2_release_runtime()`: a visit, and the Explorer on a release.\n- `form_v2_signing_maps()`, when given a release's manifest.\n- `form_v2_release_pdf()`: narrows the map and returns `pages`.\n\n**What follows from it:** only the required pages' questions are asked and checked, and only their signing lines are signed. `form_pdf_generate()` takes a `pages` option and prints just those sheets of the blank. A signed copy is stamped onto the same sheets.\n\nNothing is added to a release's manifest: the pages are worked out from the packet and form versions it already pins (`form_v2_release_pages()`).\n\n**What it narrows today** (a form required whole, or on every page it has, is untouched):\n\n| Visit type | Prints |\n|---|---|\n| SOC\/AO | unchanged; its interview and release are what they were |\n| AR, SV, PHV | 3040 page 1 |\n| AO, Change Program, Service Plan Change | service plan page 2 |\n\n**AR:** AR.json no longer asks the 3040's orientation questions (page 2, which AR doesn't print). It's now 270 questions, and its publish dry run passes every check, including the printed samples. Not published.\n\n**Tests:**\n- `scripts\/test-form-v2-pages.php`: the pure rules.\n- `test-form-pdf-compose.php`: page 2 alone prints one sheet, page 2 of the blank, and the signed copy keeps it.\n- All the Forms V2 suites pass.\n\n**For Jane:**\n- At an AR, a new attendant can still be marked AO, but their orientation page isn't printed. Is that right, or is a new attendant oriented on another visit?\n- The AO visit type prints only page 2 of the service plan. Is that what they use?\n\n**Not yet checked:** a real AR visit from start to signing in the browser. That needs AR published and switched on in dev.","assets":[],"created_at":"2026-11-05T08:24:19-06:00","updated_at":"2026-11-05T08:24:19-06:00"},{"id":2911,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/207#issuecomment-2911","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/207","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"Done in 6fe90c3.\n\n**The messages now say which office.** When a visit's forms would print the branch office's address, phone or fax blank, the message names the office (\"Not on file for the Laredo branch office\u2026\") and tells the field supervisor to ask the office to have a Superuser add it. It also says when:\n- the client has no branch in VESTA;\n- the client's branch has no office on file at all;\n- two offices share the name, so the forms can't tell which to print;\n- the detail has been added since the visit was started, so a new visit prints it.\n\n**Cassandra's screenshot was almost certainly the demo visit.** The demo client's branch (\"Demo\") had no office, so every demo visit showed those three messages. The demo client now has a made-up office, so new demo visits don't show them. A demo visit already in progress still does; start a new one.\n\n**Report:** Superuser Tools \u2192 Internal Reports \u2192 **Branch office details missing**. It checks every open client's branch and lists each branch whose office address, phone or fax is missing, with how many clients that affects. It also lists branches with no office on file, and the clients with no branch in VESTA.\n\n**Adding an office:** the Branch Offices section on Systems has a new **Add office** button. Type the branch name as VESTA has it, fill in the details, and Save.","assets":[],"created_at":"2026-11-05T09:03:41-06:00","updated_at":"2026-11-05T09:03:41-06:00"},{"id":2916,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/208#issuecomment-2916","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/208","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"Fixed in f46b569. This was a bug, not demo mode.\n\nWhen \"Is the client transferring from another agency?\" is answered **No**, the transfer statement's \"Client \/ Guardian Name\" and \"Transferring to (Agency)\" are still filled in automatically from the client record and agency, just hidden. The form correctly left them off the paper, but a separate check then counted them as answers with nowhere to print and refused to make the PDF. Any visit for a client who isn't transferring would have hit this.\n\nOnce it's deployed, press **Try generating again** on that visit. The form should print with \"Not a transfer case\" across the transfer statement.","assets":[],"created_at":"2026-11-06T09:54:29-06:00","updated_at":"2026-11-06T09:54:29-06:00"},{"id":2920,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/209#issuecomment-2920","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/209","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"Built in 5d9b526.\n\n**What happens now when a visit form can't be printed**\n- The problem is recorded once, however many times \"Try generating again\" is pressed; repeats add to a count. The record names the form, the fields involved and the generator's full message, including the PDF tool's error output. It never includes the client's answers.\n- The person at the visit sees only \"This form couldn't be printed.\" I left out \"You can carry on with the rest of the visit\": one failed form stops the client from reviewing and signing, so that sentence wouldn't have been true.\n- Superusers have a new **Form Failures** page in Superuser Tools. It shows each problem with where and how often it happened, plus links to recent visits in the current agency. \"Mark fixed\" takes an optional note. If the problem happens again, it reopens and is flagged \"Came back after a fix\".\n- People subscribed to **Notify: a visit form couldn't be printed** get an email the first time a problem appears and when one comes back after a fix, not on repeats. The email names the form, the kind of problem and the agency, with a link to the page.\n\nThe questions from the issue are settled. Only failures at real visits are recorded; proofs on the publishing screens don't go through this path. The email goes to whoever holds the new subscription.\n\n**To deploy**\n1. `php scripts\/migrate.php --apply`\n2. `php scripts\/sync-perms.php --apply`\n3. Give the \"Notify: a visit form couldn't be printed\" subscription to whoever should get the emails.","assets":[],"created_at":"2026-11-06T10:42:22-06:00","updated_at":"2026-11-06T10:42:22-06:00"}]}