Skip to content

feat(managed): https sources, the credential command and the apply report [skip release] - #418

Merged
aroff merged 1 commit into
mainfrom
feat/managed-https
Oct 10, 2026
Merged

aroff merged 1 commit into
mainfrom
feat/managed-https

Conversation

@aroff

@aroff aroff commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Slice F4 of ADR-0016 (signed managed state): a managed source can be an https:// URL.

  • https transport: the state (≤ 8 MiB) and each listed archive (≤ 512 MiB) are fetched over https. Redirects are followed only to https:// (at most 10).
  • credential_command (decision 6): runs without a shell from the configuration folder, 30 s at most. Its first line (≤ 16 KiB) is a bearer token, sent only to the source's origin; a redirect to another origin drops it. A failure or a 401 falls back to the cached state and reports sign-in needed. Without a terminal, FASTSKILL_INTERACTIVE=0 is set. Errors never include what the command printed.
  • The report (decision 15): when the state names a report_url on the source's origin, each apply POSTs a fixed JSON body (agents, skill entries with outcomes, quarantine, refusals, project skills) with a sequence that goes up by one each time. An accepted report clears the refusals it carried. Refusals are recorded by the install gate for an unexpired https state, with the command name only.
  • Decision 21: report_url/request_url on another origin are ignored with a warning. A file source ignores editable, request_url and report_url, and managed status names them.
  • managed status: shows sign-in needed, ignored fields, where reports go and last-apply warnings. --json --report prints only the next report body.
  • Apply and enroll run on a blocking thread in the CLI (reqwest blocking).
  • Docs: webdocs/cli-reference/managed-command.mdx covers sources, the credential command, https-only fields and the report.

Test plan

  • remote_tests: token from the first line; sent to the source origin only; dropped on a cross-origin redirect; http redirect refused; redirect loop stops; 401 → sign-in, 500/404 → not; size limits; credential command failures (exit code, empty, too much output, bad bytes, can't start) never leak output; working folder and FASTSKILL_INTERACTIVE.
  • report_tests against a local TLS server: https apply deploys and reports with sequence 1 then 2; refusals cleared on acceptance and kept on failure; failed sign-in uses the cache and sends no report; token reaches state, artifacts and report; off-origin URLs warn; file source ignored fields; snapshot outcomes (adopted, collision, unmanaged editable, quarantined); refusals recorded only for an unexpired https state.
  • CLI tests for sign-in, warnings, report delivery lines, status --report body and status --json --report.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo nextest run --workspace --all-features: 2207 passed
  • Modified-file coverage above 90% (scripts/check-modified-rust-coverage.py)

…port

A managed source can now be an https:// URL. Apply fetches the state and
each listed archive over https, with size limits and only https redirects.

- credential_command: run without a shell from the configuration folder,
  30 s at most; its first line is a bearer token sent only to the source's
  origin. A failure or a 401 falls back to the cached state and reports
  that a sign-in is needed. Without a terminal, FASTSKILL_INTERACTIVE=0.
- report_url: each apply sends a fixed JSON report (agents, skill entries
  and outcomes, quarantine, refusals, project skills) with a rising
  sequence; an accepted report clears the refusals it carried.
- request_url and report_url on another origin are ignored with a
  warning; a file source ignores editable, request_url and report_url,
  and managed status names them.
- managed status shows sign-in needed, ignored fields and where reports
  go; managed status --json --report prints the next report body.
@aroff
aroff enabled auto-merge (squash) October 10, 2026 11:22
@aroff
aroff merged commit 19ff3de into main Oct 10, 2026
15 checks passed
@aroff
aroff deleted the feat/managed-https branch October 10, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant