feat(job-array-one-based-index): control by identity validates first and dispatches once (task 7.4)

ControlJobByID parses every selection with ParseIdentitySelection before
any store access (first rejection: 400, nothing dispatched), collects
the jobs to act on de-duplicated by unique_job_id plus one not-found
result per missing number per selection (carrying the would-be element
ID), validates each job once after the loop and dispatches each
accepted job once. foundJob gains an explicit-index flag so
<array-id>[0] matches only element 0 and never falls back to the whole
array or an ordinary job. Fixes bug-1899 (earlier selections were
re-dispatched for every later one).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-01 12:29:19 +00:00
parent c3962e8f61
commit 4020740208
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
4 changed files with 475 additions and 241 deletions

View file

@ -163,7 +163,7 @@
- _Requirements: 5.2, 5.5, 5.6, 5.7, 5.8, 5.11, 5.12, 5.14, 5.16, 5.17_
- _Depends: 5.4, 7.2_
- [ ] 7.4 Control jobs by identity: validate first, dispatch once (fixes bug-1899)
- [x] 7.4 Control jobs by identity: validate first, dispatch once (fixes bug-1899)
- Replace the index-section parsing in this handler with the REST selection parser; validate all selections before matching; give the element matcher an explicit-index flag so `<array-id>[0]` never falls back to the whole array or an ordinary job
- Collect the de-duplicated jobs to act on and, separately, one not-found result per missing number per selection carrying the would-be element ID; validate each job once after the loop, then dispatch each accepted job once (a dispatch error stays a 500)
- Update the existing element-matcher test to the new signature with a tagged fixture