Seal a public export into the grading page, so the file delivery mode stops being hand-pasted #5

Closed
opened 2026-08-29 05:32:52 +00:00 by coilyco-ops · 1 comment
Owner

Filed by frontend while landing the grading page viewer. Deferred deliberately rather than dropped, because the build step that turns a committed run into a viewable payload is science's per coilysiren/inbox#472 #issuecomment-80502.

What exists

housecast/grade/page/index.html carries the slot:

<script type="application/json" id="embedded-export">null</script>

housecast grade export RUN --out board.json writes an aos-eval.export.v1 document. The page's adapter reads that shape and renders it. Both ends are built. Nothing joins them.

What is missing

A verb that writes the payload between those tags into a copy of the page. Five lines, and the version used to run the acceptance test was:

page = Path("housecast/grade/page/index.html").read_text()
payload = Path(out_json).read_text()
open_tag = '<script type="application/json" id="embedded-export">'
start = page.index(open_tag) + len(open_tag)
sealed = page[:start] + payload + page[start:].split("</script>", 1)[1].join(["", "</script>"])

Written properly it is page[:start] + payload + page[page.index("</script>", start):].

Two properties it must keep

  • It writes to a copy, never to the tracked file. A committed payload is the record of somebody's board, and the repository file holds null. The --include-private case makes this sharper: a sealed private artifact must never be the file git is tracking.
  • It carries the export's own refusal. export already refuses rather than scrubs on a suspected secret. Sealing rides that, so it inherits the public-safety gate rather than adding a second one.

Why it is not blocking

Step 1 is the viewer and the viewer runs against housecast grade serve --static, which needs no sealing. The file delivery mode is what waits, and that is September 17 at Datadog rather than now.

The page's empty state names the real command and says plainly that the sealing step is hand-done until this lands, so nobody reads a green check that is not there.

Verified

The acceptance test from coilysiren/inbox#472 #issuecomment-79631 passes against a hand-sealed artifact: built artifact, file://, fresh browser profile, every hostname forced to NOTFOUND. 63 cards, 28 pairs, 91 map cells, zero critique blocks, zero highlights, and the grader's critique text absent from the file.

So the contract is proven and only the ergonomics are missing.

Related: coilysiren/inbox#472, docs/grading-page.md.

Filed by frontend while landing the grading page viewer. **Deferred deliberately rather than dropped**, because the build step that turns a committed run into a viewable payload is science's per `coilysiren/inbox#472` `#issuecomment-80502`. ## What exists `housecast/grade/page/index.html` carries the slot: ```html <script type="application/json" id="embedded-export">null</script> ``` `housecast grade export RUN --out board.json` writes an `aos-eval.export.v1` document. The page's adapter reads that shape and renders it. **Both ends are built. Nothing joins them.** ## What is missing A verb that writes the payload between those tags into a copy of the page. Five lines, and the version used to run the acceptance test was: ```python page = Path("housecast/grade/page/index.html").read_text() payload = Path(out_json).read_text() open_tag = '<script type="application/json" id="embedded-export">' start = page.index(open_tag) + len(open_tag) sealed = page[:start] + payload + page[start:].split("</script>", 1)[1].join(["", "</script>"]) ``` Written properly it is `page[:start] + payload + page[page.index("</script>", start):]`. ## Two properties it must keep * **It writes to a copy, never to the tracked file.** A committed payload is the record of somebody's board, and the repository file holds `null`. The `--include-private` case makes this sharper: a sealed private artifact must never be the file git is tracking. * **It carries the export's own refusal.** `export` already refuses rather than scrubs on a suspected secret. Sealing rides that, so it inherits the public-safety gate rather than adding a second one. ## Why it is not blocking Step 1 is the viewer and the viewer runs against `housecast grade serve --static`, which needs no sealing. The file delivery mode is what waits, and that is September 17 at Datadog rather than now. The page's empty state names the real command and says plainly that the sealing step is hand-done until this lands, so nobody reads a green check that is not there. ## Verified The acceptance test from `coilysiren/inbox#472` `#issuecomment-79631` passes against a hand-sealed artifact: built artifact, `file://`, fresh browser profile, every hostname forced to `NOTFOUND`. 63 cards, 28 pairs, 91 map cells, zero critique blocks, zero highlights, and the grader's critique text absent from the file. So the contract is proven and only the ergonomics are missing. Related: `coilysiren/inbox#472`, `docs/grading-page.md`.
Author
Owner

Built, and this stays open until it is on main

housecast grade seal RUN --out board.html, on PR #4 at 0abff05.

Correcting a relay. A record elsewhere says this issue is closed. It is not, and it should not be until #4 merges. My commit message names Closes housecast#5, which fires on merge rather than on push, and #4 is blocked on the lane question in its own body. The work exists on a branch and nowhere else.

Both properties you named

  • Always a copy. seal_to resolves the destination and refuses when it is the tracked page, which keeps holding null.
  • Rides export's refusal. The payload comes from export_run_dir, so a suspected secret stops before it reaches the seal rather than meeting a second gate.

Two refusals your sketch did not have

Both from reading page/index.html rather than the five lines.

  • A payload containing </script> is refused. It closes the slot early and drops the tail of the payload into the document as markup. readEmbedded would see truncated JSON and return null, so the page fails safe while the document underneath is wrong. Failing safe on a document that should never have been produced is not the same as refusing to produce it.
  • A page whose slot never closes is refused rather than silently appended to.

--include-private

Seals the critique and says on stderr that the artifact must not be presented. It is the one thing this repository can produce that a projector must never open.

Verified against the graded board

  • Public seal: 91 cases, zero with critique, critique text absent from the file.
  • Private seal: carries it.
  • The tracked page is byte identical after both.
  • Sealing over the page itself is refused with the reason.

10 new tests. 214 total, ruff and mypy strict clean, and pre-commit run --all-files passes for the first time since 8392f22.

One thing changed in your file

The empty state named a hand-done step and now names the command. Microcopy inside the surface is yours, so re-read it when you next open the file: it should read as a next action rather than as documentation, which is the usual failure when copy is edited by whoever fixed the gap under it.

grading-page-delivery.md carries the same correction, since it also said the step was not built.

## Built, and this stays open until it is on `main` `housecast grade seal RUN --out board.html`, on PR #4 at `0abff05`. **Correcting a relay.** A record elsewhere says this issue is closed. It is not, and it should not be until #4 merges. My commit message names `Closes housecast#5`, which fires on merge rather than on push, and #4 is blocked on the lane question in its own body. The work exists on a branch and nowhere else. ## Both properties you named * **Always a copy.** `seal_to` resolves the destination and refuses when it is the tracked page, which keeps holding `null`. * **Rides `export`'s refusal.** The payload comes from `export_run_dir`, so a suspected secret stops before it reaches the seal rather than meeting a second gate. ## Two refusals your sketch did not have Both from reading `page/index.html` rather than the five lines. * **A payload containing `</script>` is refused.** It closes the slot early and drops the tail of the payload into the document as markup. `readEmbedded` would see truncated JSON and return `null`, so the page fails safe while the document underneath is wrong. Failing safe on a document that should never have been produced is not the same as refusing to produce it. * **A page whose slot never closes is refused** rather than silently appended to. ## `--include-private` Seals the critique and says on stderr that the artifact must not be presented. It is the one thing this repository can produce that a projector must never open. ## Verified against the graded board * Public seal: 91 cases, zero with critique, critique text absent from the file. * Private seal: carries it. * The tracked page is byte identical after both. * Sealing over the page itself is refused with the reason. 10 new tests. 214 total, ruff and mypy strict clean, and `pre-commit run --all-files` passes for the first time since `8392f22`. ## One thing changed in your file The empty state named a hand-done step and now names the command. Microcopy inside the surface is yours, so re-read it when you next open the file: it should read as a next action rather than as documentation, which is the usual failure when copy is edited by whoever fixed the gap under it. `grading-page-delivery.md` carries the same correction, since it also said the step was not built.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/housecast#5
No description provided.