Repository navigation
[access] test(guards): make 52 weak guard tests assert the decision, with refusal pairs - #7666
Conversation
… log nothing Assisted-by: ClaudeCode:claude-opus-5-5
…e public-host case Assisted-by: ClaudeCode:claude-opus-5-5
…n instance through Assisted-by: ClaudeCode:claude-opus-5-5
…e call's own register and schema Assisted-by: ClaudeCode:claude-opus-5-5
…through Assisted-by: ClaudeCode:claude-opus-5-5
…ped schemas save Assisted-by: ClaudeCode:claude-opus-5-5
…t and refuses nothing else Assisted-by: ClaudeCode:claude-opus-5-5
… and unresolvable steps Assisted-by: ClaudeCode:claude-opus-5-5
…judgeable Assisted-by: ClaudeCode:claude-opus-5-5
…l and registered ids Assisted-by: ClaudeCode:claude-opus-5-5
… inputs save Assisted-by: ClaudeCode:claude-opus-5-5
…ccepted Assisted-by: ClaudeCode:claude-opus-5-5
…th guard Assisted-by: ClaudeCode:claude-opus-5-5
|
Newman API Test Suite is red, and the failures are not from this PR. The job's PHPUnit step reports 11 errors and 11 failures, all in files this PR does not touch:
The same 22 tests fail identically on the unrelated #7643 (job 129021095087). The Newman runs on #7643 and #7640 are also red. This PR only edits test methods in 13 unit test files, and none of them appears in that list. No fix for these exists in any branch I can see, so none is ported here. Under the lane rules this PR gets no further commits. I did not re-run the job: the failures are deterministic mock and golden mismatches, so a re-run would fail the same way. Generated by Claude Code |
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ❌ | ||||
| psalm | ❌ | ||||
| phpstan | ❌ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ❌ | ||||
| test-l10n-parity | ❌ | ||||
| format | ❌ | ||||
| check-schema-l10n | ✅ | ||||
| test-coverage-ratchet | ✅ | ||||
| composer | ✅ | ✅ 168/168 | |||
| npm | ✅ | ✅ 641/641 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ✅ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ❌ 49147/49168 · 22 skipped (worst of 6 legs: PHP 8.3, NC stable32, pgsql; counts from 6 of 8 legs) | ||||
| Newman | ❌ 1625/1628 | ||||
| Playwright | ❌ 131/230 · 4 skipped · 259 did not run | ||||
| Hydra gates | ❌ |
Quality workflow — 2026-11-10 09:57 UTC
Download the full PDF report from the workflow artifacts.
Lane T36, round t1: strengthen provably weak tests on guard code (SIG audit). The tests were written with Claude Code.
What is covered
52 of the 68 weak tests this lane owns, in 13 test files, now assert what the guard decides. Each allow path is paired with a refusal test that flips the deciding input. The pair either already existed (named in a comment in the test) or is added here.
assertAccepted()helper. It asserts no exception and that no "blocked" warning was logged. New refusal pairs: extensionless file with a shebang, an mp4 name without anftypbox, a shebang inside the first 1024 bytes.testAssertSafeWebhookUriAllowsPublicHttpsused real DNS and errored in a sandbox without it. It now pinsOutboundAddressGuard::addressesOf. New pair: a public name with one private record is refused.find()/findAll()assert that the object handler gets exactly the call's own register and schema. New pair: a call that itself names a schema its register lacks is still refused, and the handler is never asked.assertSaveAccepted(), which asserts that no AuthorizationBlockException was raised.position:chair.validateAllreaches the last property.Only the listed methods were edited. New helpers and tests sit beside them. No production code was changed.
Numbers
php /tmp/t1/t1-tools/weak.php . /tmp/t36-weak.json tests/Unit, then the listed tests still reported:tests/Unit/Service/Object/SaveObject/FilePropertyHandlerTest.php(13, PR [access] refactor(object): freeze, file store and facet/archive constructors take request objects and bundles #7567) andtests/Unit/Service/ObjectServiceCreateMatchTest.php(3, PR [access] refactor(rbac): bundle ConditionMatcher user resolvers (6 → 4 params) #7557).What ran
vendor/bin/phpunit --no-coverageon each of the 13 files: 12 are fully green. WebhookServiceTest: everyAssertSafeWebhookUritest passes. The file still shows 14 failures or errors in other delivery tests. They are the same set as on main, minus the one this PR fixes, and they come from DNS lookups that the sandbox cannot do.Mutation samples
Each was applied by hand, run, and reverted. None is committed.
Generated by Claude Code