oficina / equipo Public

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

Plain git — no account needed to clone.

Download

Download this file

1# Project card hardening
2
3Branch: projects/card-tests, based on origin/main f6189100. The landed
4projects/card-names worktree was clean and has been removed.
5
6## Plan
7
81. Choose both existing repositories in the placement identity regression.
9 Mutate the identity condition so every option matches the first repository;
10 the second-choice test must fail, then pass after restoration.
112. Send exactly "Don't use choice03" through the device API with a visible typed
12 card and a real trusted name choice03. Mutate anchored matching to substring
13 matching; the card must incorrectly close and the regression must fail.
143. Send a matching project name with a runner below ProtocolPlacement. Observe
15 the current 409, then preflight the capability and pass through as an ordinary
16 message. Remove the preflight deliberately and observe the same failure.
174. Run the pinned gates, suites and fixture checks. Commit, scan references,
18 push only this branch through the helper, and wait for Linux CI.
19
20No runtime copy, wire shape, migrations, main push or deployment changes.
21
22## Findings and evidence
23
241. Identity mapping: the regression now chooses both old and new, checking the
25 learned name against the selected project's ID. Disabling the identity
26 condition chooses p_old for the second option and fails.
272. Phrase anchoring: the device API regression sends exactly "Don't use choice03"
28 with choice03 registered as a trusted team name. Matching use anywhere
29 incorrectly answers the card, so the state assertion fails.
303. Old runner: the new device case first reproduced HTTP 409 idempotency_conflict
31 at ProtocolPlacement - 1. Composer interception now checks placement support
32 before answering; an old runner uses ordinary send behavior instead. The card
33 stays open, words and retry identity are preserved, and the message dispatches.
34
35Test-first command: `GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test ./internal/equipo/chat ./internal/thintest -run 'TestCardNamesPlacementIdentity|TestCardNamesComposerDevice' -count=1`.
36Before the fix, the old-runner case failed with 409. After the fix both packages
37passed (0.490s and 2.698s). Each mutation below ran alone and was restored in a
38finally block. All three failed on the intended assertion.
39
40### every option matches first repository
41
42File: `internal/equipo/chat/project_resolution.go`.
43
44Changed `if choice != ProjectName(repo) && repo != p.ChosenRepo {` to `if false && choice != ProjectName(repo) && repo != p.ChosenRepo {`.
45
46`GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test ./internal/equipo/chat -run TestCardNamesPlacementIdentity/suggestion=portal/new -count=1`
47
48```text
49--- FAIL: TestCardNamesPlacementIdentity (0.06s)
50 --- FAIL: TestCardNamesPlacementIdentity/suggestion=portal/new (0.06s)
51 project_card_names_test.go:262: name learned for the wrong repository [{p_old owner@example.com portal 2026-11-12 12:00:00 +0000 UTC}] want new
52FAIL
53rastrillo-budget/v1 ran 58ms
54FAIL amadan.net/oficina/equipo/internal/equipo/chat 0.438s
55FAIL
56```
57
58### unanchored use phrase
59
60File: `internal/equipo/chat/project_composer.go`.
61
62Changed `if name, ok := strings.CutPrefix(phrase, prefix); ok {` to `if _, name, ok := strings.Cut(phrase, prefix); ok {`.
63
64`GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test ./internal/thintest -run TestCardNamesComposerDevice/negated -count=1`
65
66```text
67--- FAIL: TestCardNamesComposerDevice (0.61s)
68 --- FAIL: TestCardNamesComposerDevice/negated (0.61s)
69 project_card_names_test.go:91: card state answered want open
70FAIL
71rastrillo-budget/v1 ran 615ms
72FAIL amadan.net/oficina/equipo/internal/thintest 1.156s
73FAIL
74```
75
76### missing old-runner pass-through
77
78File: `internal/equipo/chat/project_composer.go`.
79
80Changed `if err := t.placementRunner(person); errors.Is(err, ErrConflict) {` to `if err := t.placementRunner(person); false && errors.Is(err, ErrConflict) {`.
81
82`GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test ./internal/thintest -run TestCardNamesComposerDevice/old-runner -count=1`
83
84```text
85--- FAIL: TestCardNamesComposerDevice (0.61s)
86 --- FAIL: TestCardNamesComposerDevice/old-runner (0.61s)
87 project_card_names_test.go:71: composer refused by open card HTTP 409: {"code":"idempotency_conflict","copy_key":"api.idempotency_conflict","request_id":"SIMM24KXQIDDT5NUJ2WDGNKH4O"}
88FAIL
89rastrillo-budget/v1 ran 611ms
90FAIL amadan.net/oficina/equipo/internal/thintest 1.135s
91FAIL
92```
93
94## Final local verification
95
96All commands used GOTOOLCHAIN=go1.26.11, CGO_ENABLED=0 and pinned gofmt on PATH.
97fmt-check, gitleaks, budget, migration-check, copy-release-check, lanes-check and
98spacing passed. Full suites passed: equipo 18.121s, chat 3.634s, thintest 154.219s,
99wire 0.224s, wireschema 0.618s and testci 12.915s. PersonAPI/Plan3Release passed
100in 11.433s; all seven native fixtures match the schema.
101
102Measured budgets: chat 33340 source / 8282 test lines, thintest 33989 test lines.
103The increases are five source, two chat-test and twelve device-test lines.
104Explanations remain below 200 bytes; TestBudgetRecordsAreShort passed.
105
106Fresh origin/main is f6189100454e8e914f9e87ac9c9c31d6f0e08bd0, the branch base.
107No integration merge is needed. Postcommit reference scan and Linux CI verdict
108will be reported with the pushed SHA. No copy changes or outstanding decisions.
109