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
2 changes: 1 addition & 1 deletion .data/snapshots/state_AgentA.json.meta
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"created_at": "2025-10-09T08:56:21Z", "schema_version": "v1"}
{"created_at": "1980-01-01T00:00:00Z", "schema_version": "v1"}
2 changes: 1 addition & 1 deletion .data/snapshots/state_Ambrose.json.meta
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"created_at": "2025-10-09T08:56:21Z", "schema_version": "v1"}
{"created_at": "1980-01-01T00:00:00Z", "schema_version": "v1"}
2 changes: 1 addition & 1 deletion .data/snapshots/state_agent.json.meta
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"created_at": "2025-10-09T08:56:18Z", "schema_version": "v1"}
{"created_at": "1980-01-01T00:00:00Z", "schema_version": "v1"}
2 changes: 1 addition & 1 deletion .data/snapshots/state_smoke.json.meta
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"created_at": "2025-10-09T08:56:21Z", "schema_version": "v1"}
{"created_at": "1980-01-01T00:00:00Z", "schema_version": "v1"}
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,15 @@ jobs:
# wheel paths use the data-files target path
unzip -l dist/*.whl | grep -E 'share/examples/clematis/gel/(enabled|disabled)\.yaml'

- name: Verify demo run bundle included in artifacts
run: |
set -euo pipefail
echo "Verify demo bundle is present in sdist and wheel"
# sdist paths include a top-level project dir (e.g., name-version/)
tar -tzf dist/*.tar.gz | grep -E '(^|/)clematis/examples/run_bundles/run_demo_bundle\.json$'
# wheel paths are under the package directory
unzip -l dist/*.whl | grep -F 'clematis/examples/run_bundles/run_demo_bundle.json'

- name: Assert viewer included in wheel
run: |
set -euo pipefail
Expand Down
2 changes: 1 addition & 1 deletion .logs/apply.jsonl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"turn": "demo-1", "agent": "AgentA", "applied": 0, "clamps": 0, "version_etag": "46", "snapshot": "./.data/snapshots/state_AgentA.json", "cache_invalidations": 0, "ms": 0.746}
{"turn": "demo-1", "agent": "AgentA", "applied": 0, "clamps": 0, "version_etag": "46", "snapshot": "./.data/snapshots/state_AgentA.json", "cache_invalidations": 0, "ms": 0.785}
2 changes: 1 addition & 1 deletion .logs/t1.jsonl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"turn": "demo-1", "agent": "AgentA", "pops": 5, "iters": 1, "propagations": 3, "radius_cap_hits": 0, "layer_cap_hits": 0, "node_budget_hits": 0, "max_delta": 1.0, "graphs_touched": 1, "cache_hits": 0, "cache_misses": 1, "cache_used": false, "cache_enabled": true, "ms": 0.093, "now": "2025-10-09T08:56:21.581179+00:00"}
{"turn": "demo-1", "agent": "AgentA", "pops": 5, "iters": 1, "propagations": 3, "radius_cap_hits": 0, "layer_cap_hits": 0, "node_budget_hits": 0, "max_delta": 1.0, "graphs_touched": 1, "cache_hits": 0, "cache_misses": 1, "cache_used": false, "cache_enabled": true, "ms": 0.312, "now": "2025-10-10T02:07:37.100667+00:00"}
2 changes: 1 addition & 1 deletion .logs/t2.jsonl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"turn": "demo-1", "agent": "AgentA", "tier_sequence": ["exact_semantic", "cluster_semantic", "archive"], "k_returned": 0, "k_used": 0, "k_residual": 0, "sim_stats": {"mean": 0.0, "max": 0.0}, "score_stats": {"mean": 0.0, "max": 0.0}, "owner_scope": "any", "caps": {"residual_cap": 32}, "cache_enabled": true, "cache_used": true, "cache_hits": 0, "cache_misses": 2, "backend": "inmemory", "backend_fallback": false, "hybrid_used": false, "cache_hit": false, "cache_size": 1, "ms": 0.118, "now": "2025-10-09T08:56:21.581179+00:00"}
{"turn": "demo-1", "agent": "AgentA", "tier_sequence": ["exact_semantic", "cluster_semantic", "archive"], "k_returned": 0, "k_used": 0, "k_residual": 0, "sim_stats": {"mean": 0.0, "max": 0.0}, "score_stats": {"mean": 0.0, "max": 0.0}, "owner_scope": "any", "caps": {"residual_cap": 32}, "cache_enabled": true, "cache_used": true, "cache_hits": 0, "cache_misses": 2, "backend": "inmemory", "backend_fallback": false, "hybrid_used": false, "cache_hit": false, "cache_size": 1, "ms": 0.185, "now": "2025-10-10T02:07:37.100667+00:00"}
1 change: 1 addition & 0 deletions .logs/t3.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"turn": "demo-1", "agent": "AgentA", "backend": "rulebased", "ops_counts": {"Speak": 1, "RequestRetrieve": 1}, "requested_retrieve": true, "rag_used": true, "ms_plan": 0.042, "ms_rag": 0.066, "ms_speak": 0.034, "now": "2025-10-10T02:07:37.100667+00:00"}
2 changes: 1 addition & 1 deletion .logs/t3_dialogue.jsonl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"turn": "demo-1", "agent": "AgentA", "tokens": 6, "truncated": false, "style_prefix_used": false, "snippet_count": 0, "ms": 0.026, "backend": "rulebased", "now": "2025-10-09T08:56:21.581179+00:00"}
{"turn": "demo-1", "agent": "AgentA", "tokens": 6, "truncated": false, "style_prefix_used": false, "snippet_count": 0, "ms": 0.034, "backend": "rulebased", "now": "2025-10-10T02:07:37.100667+00:00"}
2 changes: 1 addition & 1 deletion .logs/t3_plan.jsonl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"turn": "demo-1", "agent": "AgentA", "policy_backend": "rulebased", "backend": "rulebased", "ops_counts": {"Speak": 1, "RequestRetrieve": 1}, "requested_retrieve": true, "rag_used": true, "reflection": false, "ms_deliberate": 0.031, "ms_rag": 0.256, "now": "2025-10-09T08:56:21.581179+00:00"}
{"turn": "demo-1", "agent": "AgentA", "policy_backend": "rulebased", "backend": "rulebased", "ops_counts": {"Speak": 1, "RequestRetrieve": 1}, "requested_retrieve": true, "rag_used": true, "reflection": false, "ms_deliberate": 0.042, "ms_rag": 0.066, "now": "2025-10-10T02:07:37.100667+00:00"}
2 changes: 1 addition & 1 deletion .logs/t4.jsonl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"turn": "demo-1", "agent": "AgentA", "counts": {"input": 0, "after_cooldown": 0, "after_novelty": 0, "after_l2": 0, "approved": 0, "dropped_tail": 0}, "clamps": {"novelty_clamped": 0, "l2_scale": 1.0}, "cooldowns": {"blocked_ops": 0}, "caps": {"delta_norm_cap_l2": 1.5, "novelty_cap_per_node": 0.3, "churn_cap_edges": 64}, "approved": 0, "rejected": 0, "reasons": [], "ms": 0.006, "now": "2025-10-09T08:56:21.581179+00:00"}
{"turn": "demo-1", "agent": "AgentA", "counts": {"input": 0, "after_cooldown": 0, "after_novelty": 0, "after_l2": 0, "approved": 0, "dropped_tail": 0}, "clamps": {"novelty_clamped": 0, "l2_scale": 1.0}, "cooldowns": {"blocked_ops": 0}, "caps": {"delta_norm_cap_l2": 1.5, "novelty_cap_per_node": 0.3, "churn_cap_edges": 64}, "approved": 0, "rejected": 0, "reasons": [], "ms": 0.009, "now": "2025-10-10T02:07:37.100667+00:00"}
2 changes: 1 addition & 1 deletion .logs/turn.jsonl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"turn": "demo-1", "agent": "AgentA", "durations_ms": {"t1": 0.093, "t2": 0.118, "t4": 0.006, "apply": 0.746, "total": 2.629}, "t1": {"pops": 5, "iters": 1, "graphs_touched": 1}, "t2": {"k_returned": 0, "k_used": 0, "cache_hit": false}, "t4": {"approved": 0, "rejected": 0}, "now": "2025-10-09T08:56:21.581179+00:00"}
{"turn": "demo-1", "agent": "AgentA", "durations_ms": {"t1": 0.312, "t2": 0.185, "t4": 0.009, "apply": 0.785, "total": 3.189}, "t1": {"pops": 5, "iters": 1, "graphs_touched": 1}, "t2": {"k_returned": 0, "k_used": 0, "cache_hit": false}, "t4": {"approved": 0, "rejected": 0}, "now": "2025-10-10T02:07:37.100667+00:00"}
15 changes: 15 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,23 @@ All notable changes to this project will be documented in this file.




## [Unreleased]

## [0.10.3] - 2025-10-09

### M14 — Examples & fixtures (viewer/console)
- **Examples:** Added a tiny, deterministic demo bundle at `clematis/examples/run_bundles/run_demo_bundle.json` and a HOWTO at `clematis/examples/README_frontend.md`.
- **Makefile:** `demo-bundle` target regenerates the demo deterministically (fixed env + clock).
- **Viewer smoke:** `tests/frontend/test_example_bundle.py` opens the viewer over `file://` and loads the committed demo bundle via the file input; asserts snapshot panel renders; **no network**.
- **Docs:** `docs/m14/frontend.md` now includes a *Quick path* to open the packaged viewer and demo bundle using `importlib.resources.files(...)`.
- **CI:** Reproducible build workflow asserts the demo bundle ships in both artifacts (wheel & sdist).

### Notes
- No runtime behavior changes; identity path unchanged. All additions are docs/examples/tests only.



## [0.10.1] - 2025-10-09

### M14 — Viewer & Console (docs-only; identity unchanged)
Expand Down
7 changes: 5 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ include LICENSE
include NOTICE
include clematis/VERSION

recursive-include clematis/scripts *.py

# Package sources and data (only real file types present)
recursive-include clematis *.py *.json *.jsonl

# Packaged examples for post-install defaults
recursive-include clematis/examples *
# Examples: ship only docs and deterministic demo bundle (PR135)
recursive-include clematis/examples *.json *.md
include clematis/examples/run_bundles/run_demo_bundle.json
# Dotfiles are not guaranteed by generic globs; include explicitly
include clematis/examples/logs/.placeholder

Expand Down
25 changes: 22 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
# Deterministic frontend scaffolding (M14 / PR127)
.PHONY: frontend-build frontend-clean frontend-checksum frontend-offline-check
.PHONY: frontend-build frontend-clean frontend-checksum frontend-offline-check frontend-stage frontend-repro demo-bundle
.ONESHELL:

FRONTEND_DIST := frontend/dist
PKG_FRONTEND_DIST := clematis/frontend/dist

frontend-build:
@python scripts/build_frontend.py
@$(MAKE) frontend-stage

frontend-clean:
@rm -rf $(FRONTEND_DIST)
@rm -rf $(FRONTEND_DIST) $(PKG_FRONTEND_DIST)

frontend-checksum:
@python scripts/hashdir.py $(FRONTEND_DIST)

# Fail if any external URLs appear in built assets
frontend-offline-check:
@rg -n "(https?://|//cdn)" $(FRONTEND_DIST) && (echo "External URL found"; exit 2) || echo "OK: no external URLs"
@sh -c 'set -e; if rg -n "(https?://|//cdn)" $(FRONTEND_DIST) | grep -v "www\\.w3\\.org/2000/svg" | grep -q .; then echo "External URL found"; exit 2; else echo "OK: no external URLs"; fi'

# Mirror built assets into the Python package path for packaging/tests
frontend-stage:
@rm -rf $(PKG_FRONTEND_DIST)
@mkdir -p $(PKG_FRONTEND_DIST)
@cp -R $(FRONTEND_DIST)/* $(PKG_FRONTEND_DIST)/

# Wrap local reproducibility check for the viewer
frontend-repro:
@bash scripts/repro_check_local.sh --frontend

# Regenerate the deterministic demo bundle used by the viewer example (PR135)
demo-bundle:
@mkdir -p clematis/examples/run_bundles
@TZ=UTC PYTHONUTF8=1 PYTHONHASHSEED=0 LC_ALL=C.UTF-8 SOURCE_DATE_EPOCH=315532800 CLEMATIS_NETWORK_BAN=1 \
python -m clematis console -- step --now-ms 315532800000 --out clematis/examples/run_bundles/run_demo_bundle.json
12 changes: 11 additions & 1 deletion clematis/cli/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
from typing import Optional

# Reuse the single implementation that lives in scripts/console.py
from scripts.console import main as _console_main
try: # prefer packaged location
from clematis.scripts.console import main as _console_main
except Exception: # dev fallback when running from repo root
try:
from scripts.console import main as _console_main
except Exception as e: # helpful error if neither path is available
raise ModuleNotFoundError(
"Unable to import console implementation. Expected 'clematis.scripts.console' "
"when installed, or 'scripts.console' in a source checkout. If you're in 'dist/', "
"run from the repo root or install the package."
) from e


def register(subparsers) -> None:
Expand Down
Loading