fix: repair chained imports and track blocked evidence dependencies
Assistant: codex Assistant-Model: gpt-6.1-sol Assistant-Session: 01a1046e-465c-7d43-8c4c-d10f0a1feadd
This commit is contained in:
parent
28b567e588
commit
146f4e1dd3
21 changed files with 869 additions and 95 deletions
|
|
@ -340,7 +340,7 @@ class IngestionApplication:
|
|||
obligation; audit-core supplies the numerator and says nothing about
|
||||
what the answer means.
|
||||
"""
|
||||
query = parse_qs(environ.get("QUERY_STRING", ""))
|
||||
query = parse_qs(environ.get("QUERY_STRING", ""), keep_blank_values=True)
|
||||
source = (query.get("source") or [""])[0]
|
||||
if not source:
|
||||
return self._json(
|
||||
|
|
@ -371,6 +371,13 @@ class IngestionApplication:
|
|||
return self._json(
|
||||
start_response, HTTPStatus.BAD_REQUEST, {"error": "tenant_required"}
|
||||
)
|
||||
instances = query.get("stream_instance_id")
|
||||
if instances is not None and (len(instances) != 1 or not instances[0].strip()):
|
||||
return self._json(
|
||||
start_response, HTTPStatus.BAD_REQUEST,
|
||||
{"error": "invalid_stream_instance_id"},
|
||||
)
|
||||
stream_instance_id = instances[0] if instances else None
|
||||
counter = getattr(self.backend, "event_counts", None)
|
||||
if not callable(counter):
|
||||
return self._json(
|
||||
|
|
@ -378,7 +385,10 @@ class IngestionApplication:
|
|||
{"error": "reconciliation_not_supported"},
|
||||
)
|
||||
try:
|
||||
counts = counter(source, since, until, tenant)
|
||||
if stream_instance_id is None:
|
||||
counts = counter(source, since, until, tenant)
|
||||
else:
|
||||
counts = counter(source, since, until, tenant, stream_instance_id=stream_instance_id)
|
||||
except BackendUnavailableError as exc:
|
||||
log.error("reconciliation failed: %s", exc)
|
||||
return self._json(
|
||||
|
|
@ -391,6 +401,7 @@ class IngestionApplication:
|
|||
"since": since,
|
||||
"until": until,
|
||||
"counts": counts,
|
||||
**({"stream_instance_id": stream_instance_id} if instances else {}),
|
||||
# Said in the response because this is the number most likely to
|
||||
# be quoted out of context in someone else's conformance argument.
|
||||
"means": (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue