fix: emit v0.9-valid data.*-shaped target documents from both routes #144
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-server!144
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/target-dispatch-data-shape"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Both live-server target dispatch routes emitted documents with TOP-LEVEL
actor/target/delay/recurring/options(and the v1 route,schedule_id). The v0.9 schema's top level is closed(
additionalProperties: false) and has no such properties, so strictconsumers categorize these dispatches as parse errors. Verified against
staging bbpd: every live-route dispatch was answered with
event.parse-errorand no tool ran, while a directly-publisheddata-shaped target round-tripped fully (fake tool executed, domains +
relations persisted in CouchDB, queue drained). The HTTP routes were the
last server-side emitter of the pre-0.9 shape.
Changes
/api/v1/targets(target-v1-document-from-request): targetsemantics move into
data; schedule identity moves toextensions.schedule_id; the schema-requiredsources/evidencecollections are emitted.
/new/target/:actor: the legacy adapter folds its historicaltop-level envelope into
data(creating it when absent) and defaultsmissing envelope fields (
normalize-legacy-target-document); the URLactor stays authoritative and caller-owned
datavalues win overfolded top-level fields.
target-record-schedule-idreadsextensions.schedule_id(keeping v1 acceptance identities stable:
target-request:<identity>);pre-fix persisted documents keep working through the data/top-level
fallbacks, so recovery is unaffected.
publish-target-document-uncheckedreads the actor through thedata-first accessor.
investigation):
validate-document-inputis now unconditionallystrict (the
:strict-schema-pbypass is removed) and the targetcompatibility consumer (
handle-target) validates like every otherdtype. Previously top-level-shaped target documents entered the
pipeline unvalidated through both the legacy route and the
documents.new.target.<actor>consumer. The only remaining non-strictdecode is transport-metadata inspection (
transient-p).Local gates (hosted Actions distrusted; local evidence decides)
python3 -m unittest discover -s tests -p 'test_*.py' -v: 18/18 OKnix run .#star-unit-tests: all suites green — http-boundary32/32, http-target-v1 9/9, v09-runtime 8/8, plus all other required
suites (new tests assert the data shape, extensions schedule identity,
strict validation of the built v1 document, the legacy envelope fold,
caller-data precedence, rejection of undeclared legacy fields, strict
target delivery, and legacy persisted-document compatibility).
nix run .#star-integration-tests: blocked by a pre-existing,load-sensitive flake in
one-hundred-concurrent-acquires-have-exactly-one-observed-owner:under machine load (~11/32 cores) 1-2 of the 100 concurrent acquires
return
:OUTCOME-UNKNOWN(the lease store's documented at-least-oncepath: mutation submitted, response read lost; retry with the same
request-id). Identical failure was machine-recorded on clean master
c06b8fc(stash → gate → pop), so it pre-dates this change; this difftouches no lease code. The runner aborts at that suite, so the
couchdb/http-api integration suites stay blocked behind it. Merging on
green python + unit gates per operator decision; the flake deserves a
separate test-robustness follow-up (retry retryable outcomes with the
same request-id per the documented contract).
Verification beyond gates
The fixed tree will be deployed to the live star-server and proven
end-to-end through the real HTTP path:
.invalidtargets POSTed viaboth routes → acceptance docs → dispatch on
documents.target.dispatch.subfinder→ staging bbpd executes the faketool → derived domains + relations persist in CouchDB under the staging
dataset → staging queue drains with no parse-error events; the malformed
fail-safe probe still holds.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.