Skip to content

Media cognition (projection substrate) + functional web-dev benchmark (#187/#123) - #1954

Merged
joelteply merged 2 commits into
canaryfrom
feat/media-cognition-webdev-bench
Jul 18, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/media-cognition-webdev-bench

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

Finishes the reusable media-cognition substrate (the consumption half of the media arc, #187) and lands a functional web-dev benchmark that proves image-perception + code-dev in one exam (#123) — through the existing eval path, no parallel dispatch.

Builds on the substrate merged in #1953 (MediaFrame + perception::scoring).

Part A — media cognition (non-STOP-zone substrate)

  • MediaFrame::description() + FrameDescriber trait — the sensory-bridge derivative, computed at most once per content hash and Arc-shared. 13 personas needing the same image's description cost one describe call, not 13. The trait keeps media/ free of any cognition/ dep (live implementor will be cognition::vision_describe; tests stub it).
  • media/projection.rs — the ONE derive-not-clamp decision: project_image(frame, &caps, resolution, ..) selects which cached derivative a persona receives. Capability gates (non-vision can never get pixels → bridged description); resolution knobs (Full = genuine full-res source, no thumbnail cap; Scaled = role/budget/adapter-max cell; Describe/Handle = summary/placeholder rungs). Every variant holds the same Arc the SharedCompute cache holds — it selects, never recomputes or clamps. Caps + compute threaded by reference.

9 new tests. All 27 media tests green.

Part B — functional web-dev benchmark (STOP-zone, kept trivial)

The scoring engine (perception::scoring::grade_ui) already existed + was tested on canary; this wires it into cognition/eval:

  • EvalTask gains target / ui_checks / ui_pass_threshold (all serde-default → every existing gym parses unchanged).
  • perception_grade() — OBSERVES target through the persona's own identity-bearing executor (cycle.acting().executor → perception/observe → eye-node), deserializes ObserveResult, calls grade_ui. Purity: she is graded via the same eye-node path she sees her own work with — one dispatch path, mirrors the workspace-root seam exactly. No eye-node connected ⇒ fails loud, never a fabricated pass.
  • run_pass grader arm: !ui_checks.is_empty() ⇒ perception_grade (default target index.html, threshold 1.0 = "it works").
  • webdev-rs gym (6 tasks: login form, todo list, landing page, pricing cards, contact form, nav header) + EMBEDDED_GYMS entry + known_benchmarks row (Grader::Perception). Every model competes on equal footing — the structure tree is text a non-visual model reads exactly like a VLM.

13 scoring + benchmark tests green (catalog test confirms webdev-rs resolves embedded).

Boy-scout: EvalTask was derive(TS) without #[ts(export)], so its committed binding (imported by GenomeTeachParams/MinedTask/RedactMemoryParams) never regenerated and a new field silently rotted it (task #80 pathology). Gave it #[ts(export)] so the binding self-maintains; regenerated EvalTask.ts.

Why this is the right boundary

The live single-image render seam (response.rs::build_messages_with_media) already does derive-not-clamp (native-vision → full bytes, no clamp; else → description). Routing it through the projection's async cells would force that sync hot-path function async + thread SharedCompute+describer — a STOP-zone rewrite whose real payoff is the multi-persona video wall (#168: N viewers × N streams, where scaled-cell + cross-persona dedup actually bite). Auto-describe-on-ingest (vision_describe is currently on-demand-only) is the same arc. Those are the next slice, deliberately not forced into a working hot path here.

Validation

  • cargo test -p continuum-core --lib --features metal,accelerate media:: → 27 passed
  • cargo test ... perception::scoring benchmark:: → 13 passed
  • cargo check --lib clean (only pre-existing unused-import warnings)

Refs #187, #123, #29. [[perception-feedback-must-not-blow-rag]], [[media-is-compute-once-zero-copy-hardware-grade]], [[dispatch-path-purity-and-load-harness]], [[built-to-teach-lesser-tuned-intelligences-win]]

🤖 Generated with Claude Code

joelteply and others added 2 commits July 18, 2026 14:29
…lamp media cognition

The consumption half of the media substrate (#187). Two non-STOP-zone additions
on top of the content-hash MediaFrame:

- MediaFrame::description() + FrameDescriber trait — the sensory-bridge derivative,
  computed at most ONCE per content hash and Arc-shared. 13 personas needing the
  same image's description cost one describe call, not 13. Trait keeps media/ free
  of any cognition/ dep (live implementor is cognition::vision_describe; tests stub).

- media/projection.rs — the ONE derive-not-clamp decision: project_image(frame,
  &caps, resolution, ..) selects which cached derivative a persona receives.
  Capability GATES (non-vision can never get pixels → bridged description);
  resolution KNOBS (Full = genuine full-res source, no thumbnail cap; Scaled =
  role/budget/adapter-max cell; Describe/Handle = summary/placeholder rungs). Every
  variant holds the SAME Arc the SharedCompute cache holds — selects, never
  recomputes or clamps. Both caps and compute threaded by reference.

9 new tests (description compute-once + fail-cached; projection matrix: non-vision
gate, full zero-copy, scaled shared cell, forced-describe shares the one cell,
handle placeholder, is_image_bytes). All 27 media tests green.

Refs #187, [[perception-feedback-must-not-blow-rag]], [[media-is-compute-once-zero-copy-hardware-grade]]

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… what RENDERED (#123)

Proves image-perception + code-dev in one benchmark, through the EXISTING eval
grader (no parallel path). The scoring engine (perception::scoring::grade_ui) was
already built + tested on canary; this wires it into cognition/eval:

- EvalTask gains target/ui_checks/ui_pass_threshold (all serde-default → every
  existing gym parses unchanged).
- perception_grade() in eval.rs: OBSERVES target through the persona's OWN
  identity-bearing executor (cycle.acting().executor → perception/observe →
  eye-node), deserializes ObserveResult, calls grade_ui. Purity: she is graded via
  the SAME eye-node path she sees her own work with — one dispatch path, mirrors the
  workspace-root seam exactly. No eye-node connected ⇒ fails loud, never a fake pass.
- run_pass grader arm: !ui_checks.is_empty() ⇒ perception_grade (default target
  index.html, threshold 1.0 = 'it works').
- webdev-rs gym (6 tasks: login form, todo list, landing page, pricing cards,
  contact form, nav header) + EMBEDDED_GYMS entry + known_benchmarks row
  (Grader::Perception). Every model competes on equal footing — the structure tree
  is text a non-visual model reads exactly like a VLM.

Boy-scout: EvalTask was a derive(TS) WITHOUT #[ts(export)], so its committed binding
(imported by GenomeTeachParams/MinedTask/RedactMemoryParams) never regenerated and a
new field silently rotted it (task #80 pathology). Gave it #[ts(export)] so the
binding self-maintains; regenerated EvalTask.ts.

13 scoring+benchmark tests green (catalog test confirms webdev-rs resolves embedded).

Refs #123, #187, [[dispatch-path-purity-and-load-harness]], [[built-to-teach-lesser-tuned-intelligences-win]]

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit bb01ba2 into canary Jul 18, 2026
3 of 4 checks passed
@joelteply
joelteply deleted the feat/media-cognition-webdev-bench branch July 18, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant