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
8 changes: 7 additions & 1 deletion .github/workflows/firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ on:
- "tools/verify_installed_serial_sequence.py"
- "tools/verify_installed_experiment_run.py"
- "tools/verify_installed_core_plan.py"
- "tools/verify_installed_core_perceptual.py"
- "examples/core_perceptual_only.osmell"
- "examples/sequence/**"
- "examples/firmware_lifecycle/**"
- "examples/lifecycle_client/**"
Expand Down Expand Up @@ -55,6 +57,8 @@ on:
- "tools/verify_installed_serial_sequence.py"
- "tools/verify_installed_experiment_run.py"
- "tools/verify_installed_core_plan.py"
- "tools/verify_installed_core_perceptual.py"
- "examples/core_perceptual_only.osmell"
- "examples/sequence/**"
- "examples/firmware_lifecycle/**"
- "examples/lifecycle_client/**"
Expand Down Expand Up @@ -137,7 +141,9 @@ jobs:

- name: Verify installed selected Core plans against actual native sketch
if: runner.os == 'Linux'
run: python -m tools.verify_installed_core_plan dist/opensmell-0.1.0-py3-none-any.whl --host /tmp/opensmell-lifecycle-host --evidence-directory dist/lifecycle-proof/core-plan
run: |
python -m tools.verify_installed_core_plan dist/opensmell-0.1.0-py3-none-any.whl --host /tmp/opensmell-lifecycle-host --evidence-directory dist/lifecycle-proof/core-plan
python -m tools.verify_installed_core_perceptual dist/opensmell-0.1.0-py3-none-any.whl --host /tmp/opensmell-lifecycle-host --output dist/lifecycle-proof/core-plan/perceptual

- name: Verify installed serial bench over owned pseudo-terminals
if: runner.os == 'Linux'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ jobs:
python -m tools.verify_installed_cli dist/*.whl --js-exchange-directory "$RUNNER_TEMP/js-sdk-exchange"

- name: Verify installed explicit Core planning path
run: python -m tools.verify_installed_core_plan dist/opensmell-0.1.0-py3-none-any.whl --evidence-directory dist/core-plan-proof
run: |
python -m tools.verify_installed_core_plan dist/opensmell-0.1.0-py3-none-any.whl --evidence-directory dist/core-plan-proof
python -m tools.verify_installed_core_perceptual dist/opensmell-0.1.0-py3-none-any.whl --output dist/core-plan-proof/perceptual

- name: Retain Core planning evidence
if: always()
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,10 @@ The active direction covers the installed SDK/CLI, interoperable data, reusable
adapters and a reproducible ESP32 bench. Local Explorer remains a demo client.
See [the deliverables and exit criteria](docs/development-status.md#active-direction--developer-kit-and-concrete-prototype-2026-11-10).

The installed [`plan-core` quantitative path](docs/core-perceptual-planning.md)
selects one perceptual representation under an explicit unit/scale/normalization
policy, preserving exact Core bytes without inventing a measured observation.

The installed [`analyze-experiment` entry](docs/trial-analysis.md) joins explicit
caller observation IDs to trial receipts and exports loss-preserving JSON/CSV for
external analysis. Execution completion never creates a measurement.
Expand Down
114 changes: 114 additions & 0 deletions docs/core-perceptual-planning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Explicit Core perceptual planning (experimental)

`plan-core` can now select one quantitative perceptual representation without a
chemical structure. Existing semantic selection remains compatible. This opt-in
application path interprets provisional `org.opensmell.perceptual.measurements`
0.1 from Draft RFC-0005; it does not promote the scheme or change Core0.1,
Generic ResourceGraph, Device Protocol or RFC maturity. No transport opens.

## Installed normal entry

With this revision installed, or its locally built wheel:

```sh
opensmell plan-core examples/core_perceptual_only.osmell --representation-index 0 \
--profile examples/offline_core_perceptual_profile.json --duration 0.1 --output first.json
opensmell plan-core examples/core_perceptual_only.osmell --representation-index 1 \
--profile examples/offline_core_perceptual_profile.json --duration 0.1 --output second.json
opensmell encode-frame first.json --capabilities hardware/esp32/led_capabilities.json \
--output first-frame.json
```

Use your own file/profile paths outside the checkout; Core stdin `-` works.
The included source is **declared synthetic** and has no chemical representation.
Index0 produces CH0=.25,CH1=.5,CH2=1 under the explicit profile; index1 changes
CH0 to .75. The third opaque representation cannot be selected as a fallback.
All output files are new/exclusive. Exit0 planned,1 refused/invalid,2 filesystem
error. An offline plan/frame is data, not acceptance, execution or measured odor.

## Explicit policy, not inferred units or calibration

The profile still has `mapper:perceptual`, ordinary property/channel `bindings`
and supplied `capabilities`. This Core path additionally requires the recognized
application extension `org.opensmell.experimental.core-perceptual-policy`:

```json
{
"version": "0.1",
"normalization": "value-minus-min-over-range",
"measurements": [
{"property": "flower", "scale": {"min": 0, "max": 10}, "unit": "rating"},
{"property": "grass", "scale": {"min": -1, "max": 1}, "unit": null},
{"property": "wood", "scale": {"min": 0, "max": 100}}
]
}
```

This is the application author's explicit choice of the existing demonstration
formula `(value-min)/(max-min)`, not an automatic normalization or a universal
odor mapping. There is no unit conversion, calibration or efficacy claim. Source
units/scale stay untouched in snapshots; command intensities are floating-point
software mapping results. Ranges unusable by that mapper refuse.

Policy properties must exactly match bindings; each bound property must occur
exactly once in the selected representation. Missing or repeated bound properties
refuse, rather than silently ignoring data or choosing the first occurrence.
The policy's numeric min/max must equal the source scale. Unit spelling and
presence must match exactly: missing, `null` and a nonblank string are distinct.
No percent/rating/score conversion or assumed 0..100 range. Unknown policy
extensions are passive context; only documented fields affect this path.

The selected known scheme data is validated explicitly; registered Core schemes
still undergo normal whole-envelope validation. Other unselected representations
remain retained and uninterpreted. Ordinary graph perceptual mapping and existing
semantic Core mapping do not acquire this new policy requirement.

## Projection, SDK and provenance

The SDK entry stays the same:

```python
from opensmell.experimental.core_planning import plan_core_bytes
artifact = plan_core_bytes(core_bytes, profile_bytes, representation_index=0, duration=0.1)
```

The plan uses the existing offline-plan0.1 envelope. `source.document` contains
one opaque `org.opensmell.experimental.core-perceptual-representation` resource,
with selected scheme/data/context and Core odor ID. It is **not** a Molecule,
Stimulus, participant or measured Observation. An application representation does
not establish a presentation or experimental measurement event.

The reserved root extension `org.opensmell.experimental.core-perceptual-selection`
retains the explicit index and exact Core bytes/Base64/SHA-256/length. Unknown
source fields, provenance, other representations and JSON whitespace/line endings
are preserved. Parsed profile data and its declared hash are retained; profile
whitespace is not reconstructed. Hashes identify bytes, not authenticity.

Normal `plan` on the projection, frame export and sequence preflight recompute it
from retained Core bytes/index. A changed projection is refused even if an edited
plan agrees with it. Both semantic and perceptual selection markers in one graph
refuse. Reprepare changed source instead of editing generated projection fields.
The old semantic namespace/output and chemical bridge remain unchanged. Removing
source metadata does not authenticate a graph; the new opaque subject alone is
not a regular Observation accepted by the ordinary perceptual mapper.

Bounds stay Core4MiB/profile1MiB/offline plan8MiB, finite durations/intensities,
nonempty unique commands and all supplied/live target capabilities. No default
representation, profile, command, retry, discovery or automatic sending is added.

## Reproduce software interoperability

```sh
python -m build --wheel
python -m tools.verify_installed_core_perceptual dist/opensmell-0.1.0-py3-none-any.whl \
--output /tmp/new-core-perceptual-proof
```

The fresh-wheel proof runs outside checkout with inherited build dependencies,
prepares both selections, deletes original Core/profile paths, exports frames and
uses explicit Python and independent Node software endpoints. Unit/scale/policy/
index and stale-projection refusals and output collisions are checked. Optional
`--host /explicit/native-lifecycle-host` adds the actual compiled lifecycle sketch
in native `--realtime` software mode. Existing CI runs that case without flashing.
No physical delivery, participant observation, odor reproduction or independent
third-party adoption follows from these repository-owned software checks.
7 changes: 5 additions & 2 deletions docs/core-planning.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Explicit Core semantic planning (experimental)
# Explicit Core planning (experimental)

The semantic path below remains compatible. For the opt-in quantitative path,
see [Core perceptual planning and explicit unit/scale policy](core-perceptual-planning.md).

`opensmell plan-core` plans **one explicitly selected semantic representation**
from a Core0.1 `.osmell` file with an application-owned mapping/capability profile.
Expand Down Expand Up @@ -35,7 +38,7 @@ selection is supplied. Use your own Core/profile paths outside the checkout;
stdin `-` is supported for Core input. `--output` exclusively creates a new file;
stdout is available when it is omitted. Exit0 planned,1 invalid/refused,2 file error.

The first slice accepts only `type:semantic`,
The original semantic slice accepts only `type:semantic`,
`org.opensmell.semantic.annotations` version0.1, with an explicit `mapper:semantic`
profile. Known scheme data must validate. A selected unknown scheme/type/version,
invalid index, unmapped annotation set, incompatible supplied capabilities or
Expand Down
15 changes: 15 additions & 0 deletions docs/development-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ The broader roadmap remains in the [README](../README.md#roadmap).
Operational checkpoints and the short session log live in `state.json` on the
`automation/control` branch; follow its pending PR before starting new work.

## Core quantitative selection — 2026-11-25 evening

The first passive trial-analysis slice (#47) is closed. The SDK/format gap is now
[explicit Core perceptual selection](core-perceptual-planning.md): choose one
quantitative representation with explicit normalization and expected unit/scale
policy, without requiring a chemical representation or inventing an Observation.
Existing semantic output and ordinary graph mappers remain compatible.

Exit: installed Core->two distinct selected plans->frames after originals removed
->Python/Node/actual native sketch receipts; exact Core/provenance/unknown fields
retained, explicit unit presence and scale mismatch/duplicate/missing bound data,
unknown index, stale projection and output collision refusals. Close this bounded
path after CI; no automatic representation/policy catalog. Human hardware evidence
and independent adoption remain unobserved, separate whole-kit gates.

## Trial observation analysis — 2026-11-25

The first installed dossier execution path (#46) is closed. The next concrete
Expand Down
122 changes: 122 additions & 0 deletions examples/core_perceptual_only.osmell
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"opensmell": "0.1",
"odor": {
"id": "urn:opensmell:synthetic:core-perceptual",
"representations": [
{
"type": "perceptual",
"scheme": {
"id": "org.opensmell.perceptual.measurements",
"version": "0.1",
"caller_extension": "retained"
},
"data": {
"measurements": [
{
"property": "flower",
"value": 2.5,
"scale": {
"min": 0,
"max": 10
},
"unit": "rating",
"future": {
"opaque": [
null,
36893488147419103232
]
}
},
{
"property": "grass",
"value": 0,
"scale": {
"min": -1,
"max": 1
},
"unit": null
},
{
"property": "wood",
"value": 100,
"scale": {
"min": 0,
"max": 100
}
}
]
},
"provenance": {
"source": "Declared synthetic Core example; no measured participant/device outcome"
}
},
{
"type": "perceptual",
"scheme": {
"id": "org.opensmell.perceptual.measurements",
"version": "0.1",
"caller_extension": "retained"
},
"data": {
"measurements": [
{
"property": "flower",
"value": 7.5,
"scale": {
"min": 0,
"max": 10
},
"unit": "rating",
"future": {
"opaque": [
null,
36893488147419103232
]
}
},
{
"property": "grass",
"value": 0,
"scale": {
"min": -1,
"max": 1
},
"unit": null
},
{
"property": "wood",
"value": 100,
"scale": {
"min": 0,
"max": 100
}
}
]
},
"provenance": {
"source": "Declared synthetic Core example; no measured participant/device outcome"
}
},
{
"type": "caller.future",
"scheme": {
"id": "caller.unknown",
"version": "9"
},
"data": {
"opaque": [
true,
null,
1180591620717411303424
]
}
}
],
"metadata": {
"description": "Two quantitative source selections; no chemical representation and no measured odor outcome."
}
},
"future": {
"retain": "all bytes"
}
}
2 changes: 2 additions & 0 deletions examples/developer_kit/START_HERE.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,5 @@ pseudo-terminals only. Existing software sequence commands remain unchanged.
For a whole caller-ordered prepared dossier, see [RUN_EXPERIMENT.md](RUN_EXPERIMENT.md).

For passive receipt/observation joins and CSV analysis, see [TRIAL_ANALYSIS.md](TRIAL_ANALYSIS.md).

For explicit quantitative Core selection, see [CORE_PERCEPTUAL.md](CORE_PERCEPTUAL.md).
Loading