Skip to content

Agent proposal: [S5] Discovery: security.txt, CSAF provider metadata, /.well-known/tea record, repo links, reviewer… (#13) - #47

Merged
hsinatfootprintai merged 2 commits into
mainfrom
agent/issue-13
Oct 31, 2026
Merged

hsinatfootprintai merged 2 commits into
mainfrom
agent/issue-13

Conversation

@containarium-ci

@containarium-ci containarium-ci Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

For #13: [S5] Discovery: security.txt, CSAF provider metadata, /.well-known/tea record, repo links, reviewer…

Closes #13

The line above closes the issue when this pull request is merged. The agent reports 0 of 3 checklist items as met (see Acceptance below). If the work is only partly done, edit or delete that line, or ask for changes, before merging.

What and why

The platform made the commits and the branch from the files the agent handed back; it does not use the agent's own git state on the box, so anything the summary says about committing, branching or pushing describes only what the agent could do there.

The agent's summary, quoted:

Fixes the failing web test 'sends a supplied SBOM URL and the uploaded document as base64' in
web/src/lib/api.test.ts. The bug is in the test, not the code. Under vitest's jsdom environment,
TextEncoder.encode() returns a Uint8Array from another JavaScript realm, so the `instanceof
Uint8Array` check in protobuf-es fails and toJson throws 'expected Uint8Array, got object'. A real
browser upload is not affected: scan-form.tsx does not call File.arrayBuffer(). It reads the file
with FileReader.readAsArrayBuffer and wraps the result in `new Uint8Array(result)`, which uses the
page's own Uint8Array. That path is already covered by the passing scan-page upload test. The test
now builds the bytes for "{}" with Uint8Array.from([0x7b, 0x7d]) and keeps the same expected base64,
"e30=". No production code changed. Not verified: Node/npm is not installed on this box, so vitest
was not run. The change is also not committed: the sandbox needed approval for every git command in
the clone and this run could not give it, so it is only in the working tree.

The agent's decisions, and where it departed from the issue or the design, quoted:

1. Fixed the test, not web/src/lib/api.ts: the failure comes from jsdom's cross-realm TextEncoder
   output. The browser path (FileReader result wrapped in the page's own Uint8Array in
   scan-form.tsx) already passes protobuf's instanceof check, as the passing scan-page upload test
   shows.
2. Could not run vitest: Node/npm is not installed on this box.
3. Could not commit: the sandbox needed approval for git commands in the clone and none was
   available, so the change is uncommitted in the working tree; the file is returned here in full.
4. Left the SUPPLIED fetch-reason question alone, as the reviewer asked.

Changes

  • web/src/lib/api.test.ts — 83 lines

1 file(s) in all.

Acceptance, from the issue

  • ❔ unsure Parses RFC 9116 security.txt (incl. multiple `CSAF:` fields), follows CSAF provider metadata to VEX documents as DECLARED requests, records `/.well-known/tea`… — the agent says: Not touched in this revision; it only fixes the failing web test.
  • ❔ unsure Extracts GitHub/GitLab repo links from the page (ignoring badge/share links) — the agent says: Not touched in this revision.
  • ❔ unsure Reviewer-supplied SBOM/VEX by URL or upload is accepted on the CLI and in `ScanRequest`, rated High with evidence kind SBOM_SUPPLIED, and the web page (`web/`)… — the agent says: Fixed the failing web upload test; vitest not run (no Node on this box).

The items are the issue's own; each status is the agent's report, which the platform has not checked.

Checks

Review this like any other change. The agent ran on the member's own machine from the text of the issue; the platform has not built or tested it. CI results appear on this pull request.

  • Started from commit 24fe13a3a4d866814ad2c0e57365eac3dd32505d, as reported by the agent
  • Tests, as reported by the agent: not_run
How this pull request was made

Opened by the platform from a coding agent's run on a member's box (run 65355707). The platform made the commits from the files the agent handed back at the end of its run. Nothing is merged automatically.

Revised after review feedback

This pull request was revised by the agent after a reviewer's @containarium changes (comment 6535570752). The description above is the agent's account of this revision; the earlier commits are unchanged.

… /.well-known/tea record, repo links, reviewer… (#13)

Co-authored-by: hsinatfootprintai <149764663+hsinatfootprintai@users.noreply.github.com>

@hsinatfootprintai hsinatfootprintai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (comment only; this account authored the PR)

Verdict: request changes (comment): CI is red on one web test, and one design deviation needs a human decision. The Go side looks sound.
Tests run locally: go build, go vet, go test ./... on the branch head: all packages ok (cmd, discover, fetch, fingerprint, pipeline, repo, report, sbom, server, service, vuln). CI: go, e2e, proto SUCCESS; web FAILURE.
Acceptance criteria: 3/3 have code and tests on the Go side; the web part is red (below).
Deferred to verification: "Verify on dev" (a real site publishing CSAF provider metadata: security.txt and provider metadata FOUND, one VEX document parsed) is not run; the issue keeps needs-verification.
Docs impact: README +21 lines for the new request fields; looks consistent. The design doc is not updated for the new fetch reason (see below).

Blocking

  • web/src/lib/api.test.ts:29: "requestScan sends a supplied SBOM URL and the uploaded document as base64" fails in CI with cannot encode field touchstone.v1.ScanRequest.sbom_document to JSON: expected Uint8Array, got object (thrown from requestScan, web/src/lib/api.ts:24). Likely the document bytes are not a real Uint8Array in the test environment (jsdom realm mismatch with File.arrayBuffer()), but that is a guess: confirm whether a real browser upload also fails, and fix the encoding or the test accordingly.

Should fix / decide

  • Design deviation, needs a human call: the agent added a fifth fetch reason SUPPLIED for the reviewer's sbom_url (design lists four; proto comment, design table and e2e ALLOWED list unchanged). Either accept it and update the design doc, proto comment and e2e allow-list in this PR, or fetch it under an existing reason. Architectural, so left to the owner.
  • Repo links are extracted but not emitted (no report field); consumer is S6. Fine, but say so in the issue so #14 picks it up.
  • Size: about 1.7k added lines; a split (discover vs sbom vs web) would be easier to review.

Nits

  • Discovery runs after fingerprinting, sequentially, unlike the design's parallel data flow (the agent says this keeps the checked order stable). A note in the design doc would do.

@hsinatfootprintai

Copy link
Copy Markdown
Contributor

@containarium changes Fix the failing web check only: web/src/lib/api.test.ts 'sends a supplied SBOM URL and the uploaded document as base64' fails with 'cannot encode field touchstone.v1.ScanRequest.sbom_document to JSON: expected Uint8Array, got object' (from requestScan in web/src/lib/api.ts). Find out whether a real browser upload would also fail (File.arrayBuffer() result not a Uint8Array) and fix the code or the test accordingly. Do not change anything else; the SUPPLIED fetch-reason question is for a person to decide.

@containarium-ci

Copy link
Copy Markdown
Contributor Author

The agent will revise pull request #47 using that feedback. It starts from the pull request's branch and updates the same pull request when it is done; nothing is merged automatically.

Next: reply @containarium status to see the run, or @containarium stop to cancel it.

Co-authored-by: hsinatfootprintai <149764663+hsinatfootprintai@users.noreply.github.com>
@hsinatfootprintai
hsinatfootprintai merged commit a8c867f into main Oct 31, 2026
4 checks passed
@hsinatfootprintai
hsinatfootprintai deleted the agent/issue-13 branch October 31, 2026 01:41
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.

[S5] Discovery: security.txt, CSAF provider metadata, /.well-known/tea record, repo links, reviewer-supplied SBOM/VEX

1 participant