Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

### Added

- Stack Witness 0001 drift lock — `warp-wasm` now mirrors Wesley's fixture
vectors for the jedit-through-Echo walking skeleton and verifies Echo's
fixture op ids, buffer-inclusive fixture vars bytes, the
`wesley-binary/v0` target codec marker, helper entrypoints, and expected
`QueryBytes("hello")` payload bytes against that vector.
- `echo-registry-api::verify_contract_artifact(...)` — generic load-time
verification for Wesley-generated registries, including schema/codec/layout
checks, expected footprint certificate hashes, optional generated artifact
Expand Down Expand Up @@ -49,6 +54,23 @@

### Changed

### Fixed

- Stack Witness 0001 fixture observations now require the fixture
`createBuffer` and `replaceRange("hello")` history to be admitted and
materialized before `textWindow` can return `QueryBytes("hello")`.
- Stack Witness 0001 `textWindow` observations now fail closed when the bounded
read budget is smaller than the returned payload and carry a deterministic
BLAKE3 artifact hash instead of a dummy reading identity.
- Strengthened Echo's Wesley fixture-vector drift lock to cover artifact family,
schema, version, declared footprints, and generated helper field shapes.
- Corrected Stack Witness 0001 terminology so the current semicolon-kv byte
strings are fixture vars only, not Wesley's future runtime codec bytes.
- Hardened Stack Witness 0001 fixture integrity by validating fixture vars
before admission, requiring fixture intents to commit before `textWindow`
materializes, and rejecting fixture `QueryView` reads for non-default
worldlines.

### Fixed (PR #326 follow-up)

- Added regression coverage that rejects trailing whitespace in the committed
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions backlog/bad-code/RE-030-queryview-optic-convergence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!-- SPDX-License-Identifier: Apache-2.0 OR LicenseRef-MIND-UCAL-1.0 -->
<!-- © James Ross Ω FLYING•ROBOTS <https://github.com/flyingrobots> -->

# RE-030 — Converge QueryView Reads onto Optics

Legend: [RE — Runtime Engine]

## Problem

Stack Witness 0001 currently proves `textWindow` through
`observe(QueryView)` using a narrow fixture shortcut. That keeps the first
jedit-through-Echo witness small, but it also leaves query reads outside the
stronger optic surface that should eventually own read identity, aperture
identity, basis validation, rights, budgets, and capability posture.

`QueryView` should be the reading frame for a query-producing optic, not a
parallel read side door.

## Desired Shape

Model contract query reads as optic-shaped observations:

```text
contract-authored optic
focus: worldline / basis / read identity
aperture: QueryBytes {
query_id
vars_digest
}
artifact identity
observer plan
rights posture
budget posture
evidence posture
```

The Stack Witness 0001 `textWindow` path should eventually move from direct
`observe(QueryView)` fixture interception to an optic aperture that produces
`ReadingEnvelope + QueryBytes("hello")`.

## Non-Goals

Do not do this before the walking skeleton is merged and stable. The current
PR should only close the direct-path integrity gaps:

1. validate requested worldline,
2. validate fixture vars,
3. require committed fixture history before materializing the read.

## Why

Optics are the right long-term home for:

1. durable read identity,
2. query aperture identity,
3. basis and worldline validation,
4. capability-scoped rights,
5. budget enforcement,
6. debugger/TTD explanation.

Keeping the follow-up explicit prevents Stack Witness 0001 from fossilizing a
temporary direct `QueryView` shortcut into the permanent architecture.

## Effort

Medium — requires an optic-backed query aperture path plus migration of the
Stack Witness `textWindow` fixture tests from direct `observe(QueryView)` to
the optic read surface.
3 changes: 2 additions & 1 deletion crates/warp-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ default = []
console-panic = ["console_error_panic_hook", "web-sys"]
# Enable the warp-core engine kernel implementation.
# Apps compile with this feature to get a real Engine behind the WASM exports.
engine = ["dep:warp-core"]
engine = ["dep:warp-core", "warp-core/native_rule_bootstrap"]

[dependencies]
echo-registry-api = { workspace = true }
Expand All @@ -32,6 +32,7 @@ js-sys = "0.3.83"
web-sys = { version = "0.3.83", optional = true, features = ["console"] }
console_error_panic_hook = { version = "0.1.7", optional = true }
serde = { version = "1.0", features = ["derive"] }
blake3 = "1.0"

[dev-dependencies]
warp-core = { workspace = true }
Expand Down
11 changes: 6 additions & 5 deletions crates/warp-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,14 +1017,15 @@ mod init_tests {
fn neighborhood_core_publication_uses_installed_kernel() {
clear_kernel();
install_kernel(Box::new(StubKernel));
let request = ObservationRequest {
coordinate: kernel_port::ObservationCoordinate {
let request = ObservationRequest::builtin_one_shot(
kernel_port::ObservationCoordinate {
worldline_id: WorldlineId::from_bytes([9; 32]),
at: ObservationAt::Frontier,
},
frame: ObservationFrame::CommitBoundary,
projection: ObservationProjection::Head,
};
ObservationFrame::CommitBoundary,
ObservationProjection::Head,
)
.unwrap();
let core = with_kernel_ref(|k| k.observe_neighborhood_core(request)).unwrap();
assert_eq!(core.outcome_kind, AdmissionOutcomeKind::Derived);
assert_eq!(core.plurality, NeighborhoodPlurality::Singleton);
Expand Down
Loading
Loading