feat(job-array-one-based-index): REST submit creates arrays numbered from 1 (task 6.2)

preCheckJobRequest returns (n, isArray, err): a bracketed job name is
parsed by ParseSubmitIndexExpr first, so name[1-N] and name[1] create
arrays (one-element arrays included) allocated with
generateArrayJobID, stored under the bare name; expression errors are
answered 400 with their specific message and create nothing; names
without brackets take the unchanged createArrayName path. The response
names the array (jobid = array ID, new array_size, "(n elements)"),
submit-time %I/%J use the first element, and the submit and dispatch
logs identify arrays by array ID. Fixes bug-1896 for REST and xcecli.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-01 11:55:39 +00:00
parent 0318ac5f44
commit c30e5f1d82
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
7 changed files with 390 additions and 40 deletions

View file

@ -710,6 +710,9 @@ type JobSubmitResponse struct {
JobID int64 `json:"jobid"`
QueueName string `json:"queue_name"`
Message string `json:"message"`
// ArraySize is the number of elements of a submitted array; omitted
// for an ordinary job (3.2, 3.3).
ArraySize int `json:"array_size,omitempty"`
}
// Job query struct in C lib