Repository navigation
fix(trace): record HTML spec materials as HTML - #3709
Conversation
A spec or attachment capture whose body is an HTML page (it opens with a doctype or an html root element) is now stored as an .html file that holds only the page. Before, it kept the name the agent chose, usually .md, and the frontmatter header above the doctype, so readers showed the HTML source as text. The header values stay in the annotations and in the spec entry. Markdown that only contains HTML tags is unchanged. Closes chainloop-dev#3707 Assisted-by: Claude Code Signed-off-by: Jose I. Paris <jiparis@chainloop.dev> Chainloop-Trace-Sessions: a52240a5-d7d2-4dc2-8c65-a64c9d84eec8
PR validation — ✅ 3 passing
AI Session Checks —
|
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | secrets-detection |
- |
✅ sast-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | owasp-top10-2025 |
- |
| ✅ Passed | sast |
- |
| ✅ Passed | cwe-top25 |
- |
| ✅ Passed | cwe-top26-40-cusp |
- |
Scans not applied (3)
| Scan | Reason |
|---|---|
vulnerability-scan |
no manifest/lockfile changed |
github-actions-scan |
no workflow files changed |
iac-scan |
no IaC files changed |
Security context
✅ Nothing this change touches has a recorded security-fix history.
View in Chainloop ↗ · How this works ↗
Powered by Chainloop and Chainloop Trace
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Register the HTML spec sources feature in the end-to-end suite. A new scenario seeds an HTML design document, and the check verifies that its spec material holds only the page, with the doctype first. Assisted-by: Claude Code Signed-off-by: Jose I. Paris <jiparis@chainloop.dev> Chainloop-Trace-Sessions: a52240a5-d7d2-4dc2-8c65-a64c9d84eec8
The end-to-end suite passed the HTML spec sources check 3/3 with Claude Code 2.1.309 and haiku. Assisted-by: Claude Code Signed-off-by: Jose I. Paris <jiparis@chainloop.dev> Chainloop-Trace-Sessions: a52240a5-d7d2-4dc2-8c65-a64c9d84eec8
The end-to-end suite passed the HTML spec sources check 3/3 with OpenCode 2 and openrouter/anthropic/claude-haiku-5.5. Assisted-by: Claude Code Signed-off-by: Jose I. Paris <jiparis@chainloop.dev> Chainloop-Trace-Sessions: a52240a5-d7d2-4dc2-8c65-a64c9d84eec8
The end-to-end suite passed the HTML spec sources check 3/3 with Cursor and the auto model. Assisted-by: Claude Code Signed-off-by: Jose I. Paris <jiparis@chainloop.dev> Chainloop-Trace-Sessions: a52240a5-d7d2-4dc2-8c65-a64c9d84eec8
|
The HTML spec sources cell for Codex stays Unknown in this PR. We will update it once this PR is merged. A local Codex run on macOS did not test this branch: Codex runs shell commands in a login shell ( Claude Code, Cursor, and OpenCode 2 passed the check 3/3. 🤖 Opened by the eng-autopilot skill (Claude Code) for @jiparis |
Some AI coding sessions capture spec or attachment sources that are full HTML pages. Trace stored them under the file name the agent chose, usually
.md, with the frontmatter header above the doctype. A reader then showed the HTML source as text, not as a page.Now a captured text spec source whose body opens with a doctype or an
htmlroot element is stored as an.htmlfile that holds only the page. The header values (kind, URI, role, title, description) stay in the material annotations and in the spec entry of the session, as before. Redaction runs on the whole file first, so the stored page is redacted. Markdown that only contains HTML tags, such as a README banner, and image or binary sources are unchanged. The Trace README feature table has a new row for this.Tested with new table-driven unit tests for the HTML detection and for the staged file name and content of the spec material.
This change was made with AI assistance (Claude Code).
Closes #3707
🤖 Opened by the eng-autopilot skill (Claude Code) for @jiparis