oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1# Native Needs you and Today
2
3Branch: `native/needs-you`, created from `origin/main` at `eb367315` in an
4isolated worktree under the physical TMPDIR. The list/Today checkpoint was
5committed as 5f507fb9 before merging main 18fb5be4 normally (merge 3a2fc7a6).
6The merge retains both slices' reviewed copy, fixture entry points and UI
7schemes; package budgets combine the two additive device projections.
8No merge to main, deployment or release is authorized.
9
10## Source rules and scope
11
12Needs you comes from `GET /needs-you`; it remains the badge source, including
13set-aside tasks. Today is separate from that count. The existing foreground
14event stream reconciles task and card events through session.refresh, which
15reads `/snapshot`, `/tasks`, and `/needs-you`. Pull to refresh uses that same
16path.
17
18The Today projection uses the existing `/tasks` response. Tasks with live
19running or queued steps and no pending decision appear under Running now.
20Done tasks whose stable `done_at` falls on the person's local calendar day
21appear under Finished today; cancelled and reopened tasks are excluded.
22Finished rows sort by done_at then id, newest first; active rows use updated_at.
23A later note cannot move a task's completion day. Older server payloads without
24done_at still decode, but are not assigned a guessed completion day.
25
26The controller approved optional `wire.Task.done_at` on 2026-11-26 after the
27store review showed that PostThread updates updated_at on completed tasks.
28The existing DoneAt is mapped to UTC, omitted when unset, and documented in
29the generated Task OpenAPI schema. Reopening retains the old DoneAt in the
30store; completing again replaces it, following existing transition semantics.
31No transition behavior, migration, route, or runner protocol changes.
32
33The server returns the newest 100 tasks by created_at, with no pagination.
34The controller accepted this existing web-list window for slice 4 on
352026-11-26. Older active tasks or older tasks completed today can fall outside
36it. Follow-up: a bounded device query for active tasks or tasks finished
37since a supplied date. No server route is added in this slice.
38
39## Reviewed copy
40
41Approved by Luna through the controller, 2026-11-26:
42
43- `native.needs.running_now`: Running now. Today subsection heading.
44- `native.needs.finished_today`: Finished today. Today subsection heading.
45
46`chat.day.today` and `work.needs_empty` are copied byte-identical from the
47reviewed web catalog and covered by parity. Native catalog entries use the
48existing manual/translated convention; this report and source comments
49record the approval provenance.
50
51## Verification
52
53Test-first and mutation results will be recorded here as each guard is built.
54
55Initial list/Today commands:
56
57- `swift test --package-path native/apple --filter NeedsTodayTests`: with
58 empty projection/selector stubs, 4 tests failed with 5 assertion issues
59 (`needs-you-today-red.log`). Implementation then passed all four
60 (`needs-you-today-green.log`).
61- `swift test --package-path native/apple --filter NeedsInboxTests`: with
62 the badge returning nil, two tests failed with five assertion issues
63 (`needs-you-inbox-red.log`). Implementing the optional server inbox count
64 passed; the final focused run also covers task-event refresh.
65- `swift test --package-path native/apple --filter
66 'NeedsTodayTests|NeedsInboxTests'`: 7 tests passed after source restoration
67 (`needs-you-list-restored.log`). The event test verifies a refresh updates
68 the badge and Today together. The 100-task test verifies the exact returned
69 IDs, no inferred older task, the existing `/tasks` route, and bearer use.
70
71The isolated mutation runner (`$TMPDIR/needs-you-mutate.py`) applied each
72change separately, ran the focused suites, required a failing assertion
73rather than a compile error, and restored the source in `finally`.
74All 16 mutations were killed:
75
76- Allow done or cancelled work into Running now (separate mutations).
77- Drop the pending-decision exclusion or live-step requirement.
78- Ignore running steps, ignore queued steps, or choose the first live step.
79- Include non-done tasks in Finished today or ignore the calendar day.
80- Use UTC instead of the person's time zone.
81- Reverse date order or the stable id tie-break.
82- Count all tasks for the badge; add one to the inbox count; turn unknown
83 into zero; omit set-aside tasks from the count.
84
85Approved copy is present in both generated catalogs. `check-parity.py`
86includes the two newly imported web keys and passes (223 strings at this
87pre-slice-3 stage).
88
89Action integration plan (waiting for slice 3): a row derives one action from
90its current task/card. Question opens the existing native card; Merge opens
91the shared confirmation; retry uses only the row's retry decision (not every
92retry option in the full task menu); Resume/Run now use the existing pause
93rules and connection revision. Other decisions open the task. Today offers
94Undo only through slice 3's receipt, creator, merge provenance and age guards,
95with its existing confirmation. No new action authority is inferred from a
96row appearing in a list.
97
98## Stable completion time verification
99
100- Before mapping the field, `GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test
101 ./internal/equipo/chat -run '^TestTaskDoneAt' -count=1` failed with
102 `completed task has no done_at` (`needs-you-done-red.log`). The store test
103 exercises first completion, a note 48 hours later, reopening, and a second
104 completion through the existing saveTask transitions. A separate direct
105 projection test checks an offset timestamp is encoded with a UTC Z suffix.
106- Before changing Today, the focused Swift suites failed the regression
107 contrasting completion time with later notes (`needs-you-done-native-red.log`).
108 The native regression also decodes an older payload without done_at and a
109 payload with an explicit done_at field, and checks ordering uses completion.
110- The implementation passes both focused suites and
111 `go test ./internal/plan3test -run '^TestPersonAPIDeviceContract$' -count=1`.
112 OpenAPI Task was regenerated from wire schemas; only the optional date-time
113 property changed.
114- The list checkpoint native gate passed: 275 tests, string parity, both apps.
115 Final gates will be repeated after action integration.
116
117Completion-time mutations (each restored; Go command above or the focused
118Swift suites): all 15 killed by assertion failures. Remove the field mapping;
119map updated_at instead; omit UTC conversion; serialize an unset field; rewrite
120DoneAt for a later note; keep the first completion on a second completion;
121filter by activity day; sort by activity time; guess a missing completion from
122updated_at; drop the done stage; drop the local-day restriction; force UTC day
123boundaries; reverse completion ordering; reverse the id tie-break; ignore the
124native done_at field. The UTC mutation initially survived because SQLite
125normalizes loaded timestamps; the direct projection test now kills it. A
126malformed closure mutation was rejected as a compile failure and rerun with a
127valid closure; it then failed the intended calendar assertions.
128
129The existing package size exemptions increase by exactly the approved device
130field, its projection, and its regressions (wire +2 source lines; chat +4 source
131and +102 test lines). No new GET route or performance exemption is needed.
132
133## Paused for slice 3 review fixes
134
135Controller requested pausing slice 4 on 2026-11-26. All source mutations are
136restored. Completion-time native checkpoint passed 276 tests and both builds;
137the added running-order regression and its two mutations also passed (9 focused
138tests after restoration). Linux-targeted make build/vet, staticcheck v0.7.0,
139govulncheck v1.8.0, copy release, reference scan, lane check, fmt, spacing,
140gitleaks, and corrected size budgets passed. macOS build/vet/staticcheck/
141govulncheck hit the existing unix.O_PATH toolproxy compile failure. The full
142local make test run was interrupted on the controller's pause request; later
143Go targets in that loop have not run. No Linux hub verdict is claimed yet.
144The Mac fixture and slice 4 simulator were stopped. Slice 4 remains uncommitted
145in its own worktree, awaiting slice 3 integration and final validation.
146
147
148## Row actions after the main merge
149
150NeedsRowAction follows work_views.go decisionOf and work_parts.html's needs
151list, rather than promoting every item in the task menu. A row has one primary
152action: its answerable question, its open merge card's Merge choice, Try again
153only for retry/review_blocked, Resume for the matched unknown-spend connection,
154Run now bound to the current held card or predicted step offer, or Open.
155Questions use LiveQuestionCard, including typed answers and remember controls.
156Direction, recovery, settings and unknown choices open the task for their full
157context. An unknown option keeps the whole decision on the web through the
158landed slice 3 fallback. Owner/creator/lifecycle checks reuse TaskDecision and
159TaskPause; pause actions also enforce the owner role and merging exclusion.
160
161Each row reads the full task before offering a write. A failed or stale read
162falls back to Open. TaskDetailModel sends the action, so Merge retains its
163model-level confirmation and card revision, and retry/error handling stays
164shared. Resume refetches its connection after conflicts; Run now sends the
165shown step revision and connection offer. Every write refreshes the task/list.
166
167The existing task confirmation view is extracted as TaskConfirmationSheet,
168shared by task detail, inline Merge and Finished today's Undo. Undo eligibility
169and its receipt revision are unchanged from slice 3. Finished rows still use
170stable done_at, not later task activity.
171
172Initial row selector tests failed 10 assertions against an Open-only stub.
173The initial model tests failed 9 assertions against stub loading/actions.
174After implementation, the focused list/action/model and shared task-model run
175passed 37 tests. The test fixture was corrected to start a fresh session rather
176than merge an empty card array over an already-open fixture merge card; the
177Run now assertion uses the API's actual step_revision field.
178
179Commands: `swift test --package-path native/apple --filter NeedsRowActionTests`,
180then `--filter NeedsRowModelTests`, then `--filter
181'NeedsRowActionTests|NeedsRowModelTests|NeedsTodayTests|NeedsInboxTests|TaskDetailModelTests'`.
182
183The post-merge reference scan matched a retired-name pattern across a new
184test's word boundary. Renaming the test fixes the scan without changing its
185assertions or adding an exemption.
186
187
188## Row-action mutations
189
190`python3 "$TMPDIR/needs-you-action-mutate.py"` runs the two focused row suites,
191requires assertion failures, and restores each mutation in finally. All 18
192mutations were killed after restoration:
193
194- Drop the owner role or merging exclusion.
195- Promote every menu retry to a list retry; omit review_blocked; ignore the
196 stopped/terminated pause guard.
197- Ignore the merge needs state or its offered Merge choice.
198- Ignore the held-card needs state or its offered Run now choice.
199- Allow a retry to override a selected decision card.
200- Offer hold actions after needs_you clears.
201- Ignore the matching Resume connection or the resumable step.
202- Offer Run now without a predicted offer.
203- Ignore the fresh task revision or the failed-read flag.
204- Remove the row's busy guard.
205- Send Wait when the held-card row shows Run now.
206
207The cleared-hold mutation initially survived. A new regression keeps the
208step's hold/offer but clears needs_you, matching an event/refetch race; the row
209must then offer Open. The rerun kills the mutation. Earlier slice 1 and 3
210creator/lifecycle, retry, connection matching, Undo, confirmation and error
211mutations remain covered by the shared helpers' suites. The unchanged list,
212completion-time and badge mutations are recorded above.
213
214Local Go verification after merging main: make copy-release-check,
215runner-dead-references, lanes-check, fmt-check, spacing, gitleaks, budget and
216migration-check passed. Linux-targeted make build and make vet, staticcheck
217v0.7.0, and govulncheck passed. Commands used GOTOOLCHAIN=go1.26.11,
218CGO_ENABLED=0, and fmt-check used that toolchain's bin directory in PATH.
219TestTaskDoneAt and TestPersonAPIDeviceContract passed uncached. The complete
220Linux hub run remains the final gate for all make test/performance/runner-host
221checks, including the Linux-only toolproxy and namespace checks.
222
223
224## Final native interaction and visual verification
225
226`native/scripts/check-native.sh` passed after the row/Today polish: 338 tests
227in 45 suites, one pre-existing known issue, 329 byte-identical web strings,
228and both Mac and iPhone builds. A final repeat also covers the Mac capture
229fixture change; its result is retained with the validation evidence.
230
231The NeedsYouUI scheme passed all four simulator tests on
23273E0FBCC-185A-4892-889F-150F8DC9729C. It verifies three distinct row actions,
233Merge confirmation before submission, the reviewed empty state, running and
234finished Today rows, Undo confirmation, and no Undo without its server offer.
235Command: `xcodebuild -project native/ios/EquipoPhone.xcodeproj -scheme
236NeedsYouUI -configuration Debug -destination 'platform=iOS Simulator,id=73E0FBCC-185A-4892-889F-150F8DC9729C'
237-derivedDataPath native/build/Phone -resultBundlePath
238"$TMPDIR/needs-you-polish-actions-ui.xcresult" CODE_SIGNING_ALLOWED=NO test`.
239
240Screenshots exported from that result bundle are iphone-needs-you.png,
241iphone-today.png, iphone-empty.png and iphone-needs-merge-confirmation.png.
242The branch's Debug Mac app supplies mac-needs-you.png, showing the same
243three row actions and Today. Its native sidebar is collapsed using the app's
244toggle: AppKit bitmap capture does not include the composited sidebar
245material. The image captures the real window, including its toolbar; no
246image compositing or replacement content is used. The Mac capture is produced
247by `native/scripts/build-mac.sh --configuration debug` and launching the
248bundle with EQUIPO_NEEDS_FIXTURE=list and EQUIPO_FIXTURE_CAPTURE set.
249
250All images and validation logs are in the audit site's build/slice4 directory.
251No new copy questions remain. The 100-task window follow-up remains as noted
252above. Linux hub CI is checked after the normal helper push.
253
254## Screenshot review polish
255
256The controller requested consistent clock formatting, no redundant Needs you
257badge in its own list, a shared task header on the question row, and completion
258time on the status line. Needs you now suppresses only its row badge; other
259lists keep it. Questions retain the native answer/set-aside controls beneath
260the shared project, title, status and task-opening chevron. The stopped status
261line stays: work_parts.html's task-row retains that line, as the controller
262confirmed.
263
264The clock regression failed four assertions before the fix: TimeWords used
2650:20 in en_IE and en_GB. It now pads 24-hour hours while preserving the locale's
26612-hour clock. Completion status uses the same TimeWords. Luna approved
267native.needs.done_at = "Done at %@" on 2026-11-26 for unmerged tasks. Merged
268tasks use the byte-identical web work.merged pattern and merged.at; without
269merge metadata they retain their existing status rather than invent a time.
270The new completion-status test failed two assertions against a nil stub.
271Both tests pass after implementation. Explicit mutations remove hour padding,
272use generic completion words for merges, and use done_at instead of merged.at.
273The UI suite additionally checks the question's task header, absence of the
274redundant badge, and the reviewed merged-time status.
275
276After screenshot review polish, `native/scripts/check-native.sh` passed with
277340 tests in 45 suites, one existing known issue, 330 parity strings, and both
278app builds. All three polish mutations were killed. The NeedsYouUI scheme
279passed all four tests again (`needs-you-reviewed-ui.xcresult`), and all four
280iPhone screenshots plus the Mac screenshot were recaptured and inspected.
281The latest evidence supersedes the earlier pre-review screenshots/logs.
282
283## Linux contract-fixture correction
284
285The first Linux hub run on dd5f67df failed check shard 7: TestContractAutoMerge
286and TestContractPublishSite rejected the additive done_at field as unexpected.
287The other check shards passed; perf was skipped after this failure. The strict
288completed-task fixtures had not been updated alongside the projection.
289Only task-merged.json and task-published.json now include a UTC completion
290timestamp. No production behavior changes in this correction.
291
292`GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test ./internal/thintest -run
293'^(TestContractAutoMerge|TestContractPublishSite)$' -count=1` passes (1.746s).
294`python3 native/scripts/check-fixtures.py` passes. The initial failed hub JSON
295is retained as validation/ci-first-failure.json. A new normal commit/push
296starts a fresh full Linux gate.
297
298## Fable review corrections, 2026-11-26
299
300Review of 2b9e7ef1 found that decision rows had lost Set aside and Undo.
301NeedsTaskRow now uses the existing SetAsideButton and AsideStub for merge,
302direction and held cards, through the same revision-bound visibility endpoint.
303An aside card offers no primary action, including when a previously rendered
304button's closure is still available. The existing question card continues to
305provide its own answer and visibility controls.
306
307Run now captures the displayed prediction and sends its step, step revision
308and offer through the slice 1 task run-now endpoint. It never substitutes the
309held card's unbound answer. A changed offer retains api.offer_changed. Resume
310and Run now both refresh the inbox and reload the row. The old Resume
311connection is cleared before the task read, including when no new resumable
312step exists.
313
314Questions render from the card and listed task before GET /tasks/{id}.
315A successful inbox refresh advances a row-read generation, so pull-to-refresh
316retries a failed detail read even when the task revision has not changed.
317Today uses only the last step, excluding copy holds and skip offers, matching
318workingNow. A still-running earlier Preview does not put a finished last step
319back in Running now.
320
321Correction to the earlier screenshot report: work.merged's second slot is a
322commit, not a time. Luna approved native.needs.merged_at =
323"Merged into %1$@ at %2$@" (branch, TimeWords time), 2026-11-26. Both native
324catalogs use that key; the reviewed web string stays unchanged.
325
326Test-first command:
327swift test --package-path native/apple --filter 'NeedsRow|NeedsToday'
328The initial run failed on the missing row visibility/read-generation APIs.
329The implemented baseline passed 23 tests in four suites. Added tests cover
330all three decision kinds, revision-bound Set aside/Undo, an aside primary
331action's suppression, question rendering before reads, failed-read recovery,
332a stale Resume connection, both post-action refreshes, the shown Run now
333offer changing before the tap, and an earlier running step/copy holds.
334
335Review mutation commands:
336python3 "$TMPDIR/needs-review-mutate.py"
337python3 "$TMPDIR/needs-review-extra-mutate.py"
338Each runs the focused suite after one deliberate mutation, requires an
339Expectation failed result, and restores the source in finally. The first
34013 mutations were killed: missing Set aside control, aside primary action,
341aside stub, replacement of the shown offer, missing held-offer guard,
342question blocked on read, fixed refresh key, stale Resume retained,
343missing inbox refresh, missing row reload, earlier running step selected,
344copy hold included, copy skip included. Two more removed the visibility
345busy and canSetAside guards and were killed. A stale-tap guard initially
346survived because the held-card fixture had no offer; adding its real
347prediction makes this a meaningful test of a queued Run now tap after
348Set aside. Final result follows below.
349
350All 16 review mutations are killed, including the strengthened stale-tap case.
351Restored-source validation:
352- native/scripts/check-native.sh: passed; 343 tests in 45 suites, one existing
353 known issue; 330 parity strings; both Mac and iPhone Simulator builds.
354- xcodebuild -project native/ios/EquipoPhone.xcodeproj -scheme NeedsYouUI
355 -configuration Debug -destination 'platform=iOS Simulator,id=F7282573-4021-4BF7-8118-772D452597FF'
356 -derivedDataPath native/build/Phone -resultBundlePath
357 "$TMPDIR/needs-review-ui-final.xcresult" CODE_SIGNING_ALLOWED=NO test:
358 all five tests passed. The initial UI build caught a test query typo
359 (XCUIElement versus XCUIElementQuery count), corrected before this run.
360- native/scripts/build-mac.sh --configuration debug: passed.
361
362Recaptured and inspected iphone-needs-you.png, iphone-needs-aside.png and
363mac-needs-you.png; refreshed Today, empty and merge-confirmation captures too.
364The new aside image shows the real native stub and Undo; the ordinary list
365shows Set aside on the merge row. Screenshots and mutation/gate logs are in
366the audit site's build/slice4 and validation directories. No new copy questions.
367
368## Refresh follow-ups, 2026-11-26
369
370Branch `native/needs-you-followups`, from origin/main `7c113ac8`.
371The last matching Resume connection survives task/connection reads and
372transient network failures. A changed hold or authoritative connection result,
373or a refused task/connection/resume request, clears it. Existing task revision
374freshness guards remain in force. A refused Resume clears before its refetch,
375so a second tap cannot reuse a rejected pause revision.
376
377Event refreshes no longer bump every row's read key. The task revision drives
378row reads; explicit Needs you pull-to-refresh and read-error Retry also bump
379the retry generation. Unchanged successfully read rows skip HTTP even then;
380failed task or connection reads retry. Resume/Run now retain their forced
381post-action task read. Direction Set aside now pins `aside: true` in the actual
382request, and Undo pins false.
383
384Test-first commands and evidence:
385- `swift test --package-path native/apple --filter 'NeedsFollowupTests|NeedsRowModelTests'`
386 failed with 15 assertion issues before the behavioral implementation
387 (after correcting a test-only private-setter compilation error).
388- Focused restored-source suite including StoppedWorkReviewTests passed 30
389 tests before adding the final retry/changed-hold cases.
390- `python3 "$TMPDIR/needs-followups-mutate.py"` and
391 `python3 "$TMPDIR/needs-followups-extra.py"`: all 14 mutations killed.
392 The failed-task retry mutation initially survived because the fixture had
393 never loaded successfully. Added a previously successful row whose later
394 read fails; the same mutation then failed on read count and recovery.
395
396Mutations: clear before task read; clear before connection read; remove row
397revision cache; ignore changed revision; ignore failed task read; ignore
398failed connection read; refresh every event; never retry failed rows; retain
399refused task connection; retain refused connection response; retain refused
400Resume before refetch; retain removed hold; direction Set aside sends false;
401retain changed step connection while reading. Each was restored in `finally`;
402each killed run contains an assertion failure, not a compiler error.
403
404The gate also imports main's two missing reviewed web reason strings,
405`work.reason.merge_credential` and `work.reason.amadan_unreachable`, unchanged.
406No new copy and no server behavior changes. Evidence is under the audit site's
407`build/slice4/validation/followups/` (red/green logs, mutation scripts/results,
408and native gate).
409
410Final `native/scripts/check-native.sh`: passed, 354 tests in 47 suites with
411one existing known issue, 332 parity strings, Mac and iPhone Simulator builds.
412`git diff --check`: passed. Post-commit reference scan and Linux CI verdict
413are recorded with the pushed head in the evidence directory.
414