Skip to content

Allow configured loopback Loki endpoints for native-data - #919

Draft
seathatflowsinourveins wants to merge 2 commits into
mainfrom
codex/ns2604-native-data-loki-20261009
Draft

seathatflowsinourveins wants to merge 2 commits into
mainfrom
codex/ns2604-native-data-loki-20261009

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator

Scope

NativeStack2604 uses Loki on port 21300, but native-data's config validation required the authoring host's port 13100. Accept the configured loki_url for HTTP IPv4 loopback literals (127/8) or IPv6 ::1, an explicit valid port and the exact /loki/api/v1/push path. The existing publisher already sends to config["loki_url"]; removing the fixed endpoint restriction makes that configuration usable.

  • Base commit: 52ed48881115adb072385456060a80e70e57e3d8.
  • Lane: lane:shared, because the required evidence hash registrations touch the shared manifest. Other-lane acknowledgement remains required before merge.
  • Owned paths: observability/native-data/snapshot.py, observability/native-data/README.md, tests/test_native_dashboard_data.py, and only those three entries in manifests/evidence.json.

SOTA sources

  • python/cpython v3.13.16, Lib/ipaddress.py: maintained loopback classification and strict IP literal parsing. IPv6 classification delegates mapped addresses to IPv4, so the collector explicitly restricts IPv6 to ::1.
  • python/cpython v3.13.16, Lib/urllib/parse.py: URL parsing strips controls. Validate the untouched string first to reject control characters, DNS names, userinfo, scope identifiers, query/fragment delimiters and path variants. Retain existing proxy suppression and redirect rejection.
  • grafana/loki v3.7.8, push API reference and POST route registration, matching the official Loki API. The intended service's buildinfo reports 3.7.8, revision 09e6ce2f. The collector keeps the supported JSON push envelope and content type.
  • Existing native adapter/config/service/timer at repository base 52ed48881115adb072385456060a80e70e57e3d8; this change uses the installed standard library and the existing adapter without adding a dependency or replacing a native runtime.

Evidence-class table

Claim Evidence class Command / receipt
The configured arbitrary loopback port receives the publisher's JSON request with the native-data service label local_integration test_publish_posts_to_the_configured_loopback_endpoint: a local HTTP listener, synthetic collection rows, actual existing HTTP transport and main entrypoint; HTTP 204
Loopback literals/port boundaries are accepted; DNS, remote, scoped/mapped IPv6, malformed URLs and control injection are rejected synthetic Acceptance/rejection fixtures in tests.test_native_dashboard_data
Existing collector projection/privacy/process guards still pass local_integration 46 tests in tests.test_native_dashboard_data, rc 0
Publication integrity/scope checks pass after updating only the three changed evidence registrations local_integration scripts/validate.py, rc 0; 10921 hashed files checked
Loki JSON endpoint and Python validation behavior match the installed versions source_review Pinned primary sources above; installed ipaddress check and Loki buildinfo

Local commands run

timeout 600 nice -n 10 ionice -c2 -n7 python3 -B -m unittest tests.test_native_dashboard_data -v
46 tests; OK; rc 0

timeout 600 nice -n 10 ionice -c2 -n7 python3 -B scripts/validate.py
status passed; rc 0

git diff --check
rc 0

Decision record

The NativeStack2604 section in observability/native-data/README.md records the configurable endpoint, private-config and published timer requirements, report-source dependency and post-application acceptance. The dated 2026-10-09 source/proposal record accompanies the CC packet. A strict regex on the original string plus the maintained IP parser was selected over parser-only URL validation because the parser normalizes controls. A change in upstream IP/URL semantics would require rerunning the boundary tests and reviewing the guard.

Placeholder-only private-config and user-timer diffs, each with an inverse, are retained in the CC coordination packet with SHA-256 custody. The CC must render and apply them privately with config mode 0600 and state mode 0700. Context Mode for both clients, Headroom and jCodeMunch come from an existing current token_report and matching scope labels; this collector does not refresh that producer. No private configuration or systemd unit is installed by this PR or this lane.

Host acceptance remains pending CC application: a positive Loki count_over_time({service_name="agent-stack-native-data"}[30m]), then native-foundation-data screenshot, zero console errors/failed network requests and the current generation across savings, memory and coverage panels. Buildinfo and local fixture HTTP tests do not establish host ingestion.

Host evidence

No files under evidence/hosts/ or platform status fields change. No native-proven ingestion claim is made.

Checklist

  • No new or changed GitHub Actions; workflow pin/permission requirements remain intact.
  • No secrets printed, logged or committed; private proposal roots and identifiers are placeholders.
  • No new paid hosting, subscription or billing surface.
  • Peer-owned files and worktrees preserved.
  • Designated independent reads, green CI, co-op pre-cue result, other-lane acknowledgement and explicit CC cue before 5f landing.

@seathatflowsinourveins seathatflowsinourveins added the lane:shared Touches files owned by both lanes; needs both lanes' acknowledgement label Oct 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:shared Touches files owned by both lanes; needs both lanes' acknowledgement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant