Skip to content

L0: add sys.digest, a host-resolved digest source - #40

Merged
ymote merged 1 commit into
mainfrom
feat/sys-digest-source
Oct 1, 2026
Merged

ymote merged 1 commit into
mainfrom
feat/sys-digest-source

Conversation

@ymote

@ymote ymote commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Adds sys.digest(app:, id:, fields:) to the L0 source catalog. It's the host-resolved source that OctoSense ADR 0002 §7 ("Cards", item 1) and milestone M4 describe. With it, a glance card binds to a digest the host holds for its own app, with provenance, and doesn't carry the findings as text.

What changes

  • Catalog (catalog::SOURCES, ANSWERS, docs/ui-l0-constructors.toml): args app, id, fields. It returns one record whose shape doesn't depend on the template that produced the digest:
    • status: ready, partial, failed, missing or expired
    • topic, language, summary, retrieved_at, count
    • points: rows {id, text, label, cite, citations}. citations are indexes into sources, and cite is the same list as 1-based text.
    • sources: rows {id, n, title, source, url, published_at}
    • Row fields are pooled with the record's in fields:, the same way sys.weather's days are.
  • Checker: app is required and must be a literal app id. The host compares it with the publishing app, which is the caller and never an argument, so a card can't compute it. id is required. It can be a literal in the run-id charset [A-Za-z0-9_-]{1,64} (so it can't be a path to a file) or a path into state.
  • Host-answered only (§5.11): makepad::vm_call returns None. every_offered_field_has_a_translation now has a HOST_ONLY list and asserts that such a capability never gains a lowering.
  • Read-only: it isn't in MUTABLE.
  • Docs: new profile §5.14 covers whose digest a card can read, the shape, that links come only from sources, and that a missing or expired digest resolves to an empty record with $state .failed.

The OctoSense glance service implements the resolver, together with retention, expiry and size caps, in a follow-up draft PR that pins this branch.

Tests

  • cargo test -p octoscript-ui-l0 passes. New tests/digest.rs and fixture digest.card cover admission, the source plan, realization with a ready digest and a missing one, the argument rules (required, literal app, no traversal, id from state), read-only status, and that there's no backend call.
  • cargo clippy -p octoscript-ui-l0 --all-targets --all-features -- -D warnings and cargo fmt --check are clean.

🤖 Generated with Claude Code

An app's agent findings become a source the host resolves, with provenance,
instead of text the card carries (OctoSense ADR 0002 section 7).

- Catalog: `sys.digest(app, id, fields)`, answering one template-independent
  record: status, topic, language, summary, retrieved_at, count, points
  ({id, text, label, cite, citations}) and sources ({id, n, title, source,
  url, published_at}). Row fields are pooled with the record's, as a
  forecast's days are.
- Checker: `app` is required and must be a literal app id (the host compares
  it with the publisher); `id` is required, a literal in the run-id charset
  [A-Za-z0-9_-]{1,64} or a path into state.
- Host-answered only: vm_call has no lowering, and the translation test
  checks that it never gains one.
- Read-only (not in MUTABLE).
- Docs: profile section 5.14 and the TOML entry; tests and a fixture card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ymote
ymote merged commit 30a21b7 into main Oct 1, 2026
8 checks passed
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