Skip to content

[DRAFT] feat/wow-integrity-and-focus-v13#678

Draft
elasticdotventures wants to merge 6 commits into
mainfrom
feat/wow-integrity-and-focus-v13
Draft

[DRAFT] feat/wow-integrity-and-focus-v13#678
elasticdotventures wants to merge 6 commits into
mainfrom
feat/wow-integrity-and-focus-v13

Conversation

@elasticdotventures

@elasticdotventures elasticdotventures commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Needs human resolution

Branch: feat/wow-integrity-and-focus-v13
Commits: 6
Conflicts: None detected yet — needs rebase validation
Note: Canonical WOW/FOCUS branch. Contains integrity system, AbDataSchema, FOCUS v1.3, CandleModel singleton refactor, worker role. This is the canonical version — duplicate branches (fix/crit-wow, review/synergy-unstaged) have been deleted.
Recommendation: Rebase on main, verify CandleModel refactor doesn't conflict with merged changes, then merge.

promptexecutionerr and others added 6 commits May 3, 2026 07:43
- Update just-mcp to latest commit
- Update rmcp-rust-sdk to latest commit
- Register foundry-samples submodule (Azure AI Foundry examples)
- Add cache/ to .gitignore for session artifacts

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add gix-attributes and bstr dependencies for git attributes parsing
- Implement apply_git_attributes_to_config() to overlay b00t.* attributes onto datum configs
- Support status, enabled, status_msg, replacement, and custom git attributes
- Add new viz command with VizCommands subcommand handler
- Extend BootDatum with operational metadata fields (status, enabled, status_msg, replacement, git_attributes)
- Add VisualizationSpec for render configuration
- Update datum display to show operational metadata section
- Add comprehensive tests for git attributes overlay in nested and root directories
- Update justfile with viz-entangle recipe for visualization entanglement

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…tegration, t00n format, AbDataSchema trait, opencode-b00t fork

- Worker role: default agent with governance safety gates, KnownRole sealed
  enum, AgenticRole trait with const NAME and type-level invariants
- A/B experiment system: reasoning reviewer, no-tie scoring, FOCUS records,
  sm0l validation gate (b00t validate)
- FOCUS v1.3: focus.schema.tomllmd auto-generated from FocusSchema struct,
  43 CostAndUsage headers, AbDataSchema/AbDataFrame/AbDataSequence traits
- ledgrrr: FOCUS crate with Arrow RecordBatch serde, wired into ledgerr-mcp
  MCP server (ledgerr_focus tool with 4 actions, JSONL persistence)
- t00n: TOON format implementation for token-efficient FOCUS records,
  reqif.yaml requirements embedded in FocusSchema::requirements()
- opencode-b00t fork: submodule at vendor/opencode-b00t, config.ts hook
  queries b00t-cli at startup, 9 skills, 15 agents, 21 commands, 80+ context
- Skill resolver: lazy loading with 5s timeout, global cache with 60s TTL,
  template rendering (PID/TIMESTAMP/BRANCH context vars)
- b00t-cli commands: experiment run/status, validate, schema generate,
  whoami defaults to worker role
…ve, justfile modules, candle fix

- WOW integrity system: 5 MECE category traits (BuildIntegrity, TypeInvariant,
  Boundary, Deployment, DesignHeuristic), registry with init_default_checks(),
  wow_test! macro generating #[test] + doc examples, b00t wow check command,
  RHAI executable primitives with Benders decomposition master
- AbDataSchema/AbDataFrame/AbDataSequence/AbDataHeader: generic type invariant
  for protocol transformation handlers. FocusSchema, GrpcSchema, SqlSchema,
  ArrowSchema implementations. FocusJsonlSequence for streaming.
- FOCUS v1.3: auto-generated focus.schema.tomllmd (43 headers), b00t focus
  query/aggregate/export/history/tail/merge commands, ledgerr-mcp focus_tool
  MCP handler with JSONL persistence, focus_records.jsonl AbDataSequence
- Model lifecycle: b00t model train (candle LoRA, .training.tomllmd,
  FSL→adapter pipeline), model serve --adapter, model test, model prune,
  validate --auto-train trigger
- Justfile reorganized: 1117→830 lines, 65→43 recipes. mod b00t (46 recipes),
  mod ledgrrr (8 recipes), mod irontology (3 recipes). Runtime detection
  datum (systemd/docker/podman).
- Candle build fixed: 0.4→0.10, zero code changes beyond API adaptation
  (Tensor::new as_slice, forward KV cache arg). WOW check A2 enforces.
- KnownRole sealed enum: resolves resolve_role() type invariant hole.
  worker_role() + from_env() with Cow<str> zero-alloc default path.
- sm0l validation gate: validate --jsonl --schema --auto-train, FSL example
  store at .b00t/fsl/focus-examples.jsonl, in-context learning pipeline
…le.rs into reusable CandleModel singleton

- CRIT-3: Remove CandleBuildCheck and DefaultBuildCheck from wow.rs
  Rust trait implementations. These spawned  as subprocess
  causing 2+ minute unit test times. Build integrity checks stay as RHAI
  scripts at _b00t_/scripts/wow/check-*.rhai.
- MAJ-1: Refactor candle.rs generate_text() free function into CandleModel
  struct with load() + generate() methods. Model loads once per process
  lifetime via OnceLock<Mutex<Option<CandleModel>>> singleton. Subsequent
  calls reuse loaded weights, tokenizer, and device — no O(1GB) reload.
  generate_text() wrapper preserved for backward compatibility.
- CRIT-1: Replace reqwest::blocking with curl in doctor_cmd.rs
- CRIT-2: Remove dead curl call to /v1/chat/completions in emit_focus...
- CRIT-5: Remove duplicate name key in ledgrrr.cli.toml
- MAJ-3: Word-boundary token match in governance_gate
elasticdotventures added a commit that referenced this pull request Jul 15, 2026
…res (#828)

* fix: NatsSubscription mock hang + nested block_on in adapter tests

Two independent, real bugs, both discovered because they hang/panic the
`cargo test -p b00t-cli --lib` pre-push gate (not infra-dependent — no
NATS server needed for either):

1. MockNatsSubscription::next() used a blocking `rx.recv()`. Two tests
   (mock_transport_no_server_needed, mock_transport_publish_before_
   subscribe_lost) deliberately assert no message ever arrives — with a
   blocking recv() that can never return (the sender lives inside the
   still-alive MockNatsTransport and is never dropped), those tests hang
   forever by construction. mock_transport_round_trip hung for the same
   reason via a second bug: it published *before* subscribing, so its
   message was silently dropped per the mock's own documented semantics
   (see the other two tests), leaving nothing for its recv() to receive
   either. Fixed: next() uses try_recv() (this mock is fully in-memory
   and synchronous, so there's nothing to legitimately block-wait for by
   the time next() is called), and round_trip's publish/subscribe order
   is corrected.

2. NatsClientAdapter's publish()/subscribe() are sync methods that
   internally call `Handle::current().block_on()` (by design — see the
   module doc). Three #[tokio::test] async fn tests called them directly
   from within the test's own tokio runtime, which is exactly the
   forbidden nested-block_on pattern ("Cannot start a runtime from
   within a runtime"). Fixed by wrapping each test's sync call sequence
   in tokio::task::spawn_blocking, which moves it off the runtime's
   worker thread. NatsClientAdapter's own implementation is unchanged —
   it's correctly designed for genuinely-sync callers, per the module
   doc; these three tests were the only callers violating that contract.

Not fixed here (separate, deeper issues, out of scope for this fix):
pipeline_executor::tests::nats_mode_passes_data_between_stages hits the
same "Cannot start a runtime from within a runtime" panic, but from
*inside* PipelineExecutor::execute's own async logic calling into
NatsClientAdapter — a real production-code sync/async boundary bug, not
a test-only issue, and not safely fixable with a test-side wrapper.
Also still failing on main, unrelated to this fix: pipeline_cost's
unknown-pipeline validation, pipeline_flowctl's buffered/throttled
timing assertions, pipeline_k8s's GPU-resource-limit YAML generation,
and pipeline_statemachine's transition-count assertion — five distinct,
genuine, pre-existing logic bugs surfaced by running the full gate,
none touched by this commit.

cargo test -p b00t-cli --lib pipeline_nats::: 14/14 pass (was 3 hangs +
3 panics before this fix).

* fix: close remaining cargo test -p b00t-cli --lib pipeline_* gaps

Full gate now 100% green (1302 passed, 0 failed, 4 ignored, ~12s — was
hanging indefinitely before the companion mock-transport commit, then
6 more genuine failures after that hang was fixed). Six independent,
root-caused fixes, each tracked by its own issue per operator instruction
to create issues before closing gaps and to check for existing PRs first
(none of the three open PRs — #782, #783, #678 — touch any of these
files; #783 is CONFLICTING/unrelated obsidian-mcp+justfile work, #678 is
an unrelated draft):

Closes #819 — pipeline_flowctl Throttled: can_emit()'s decision used an
elapsed-based rate (bytes / elapsed_seconds), unstable near t=0 since a
near-zero elapsed time inflates any nonzero byte count into an apparent
rate of hundreds of thousands of bytes/sec. Fixed to compare the raw
throttle_window_bytes accumulated in the current window directly against
max_bytes_per_sec.

Closes #820 — pipeline_flowctl buffered_blocks_when_full (test-only):
asserted the buffer was empty after accepting only 1 of 3 emitted items;
FlowControl was correct, the test's own sequence didn't match its final
assertion. Drains the remaining 2 items before asserting emptiness.

Closes #821 — pipeline_k8s generate_deployment: only checked each
stage's own profile.resources.requires_gpu, never the capsule-level
CapsuleSpec.resources.requires_gpu the test (and presumably real
capsule-wide GPU declarations) set. Now checks either.

Closes #822 — pipeline_statemachine happy_path_idle_to_completed
(test-only): asserted 7 history entries but its own comment lists 6
events, and the sibling history_tracks_all_transitions test proves the
implementation records exactly one entry per transition() call (doubly
confirmed correct). Fixed the assertion to 6.

Closes #823 — pipeline_cost handle_forecast_unknown_pipeline (test-only,
renamed): expected an error for any unrecognized pipeline name, but two
sibling tests (sample_stages_for_unknown_id, build_report_unknown_pipeline)
establish, by design, that unrecognized names get a graceful synthetic
1-stage "custom pipeline" fallback rather than a hard failure. 2-vs-1
consensus among existing tests — aligned this one with the established,
doubly-confirmed intended behavior instead of contradicting it.

Closes #824 — pipeline_nats NatsClientAdapter: publish()/subscribe()
called Handle::current().block_on() internally, which panics ("Cannot
start a runtime from within a runtime") when invoked from code already
running on that same runtime thread — which PipelineExecutor::execute's
own async logic does for real "nats mode" pipeline runs, not just tests.
Added block_on_fresh_thread(): spawns a dedicated OS thread and calls
block_on there, which is always safe regardless of runtime flavor
(current_thread vs multi_thread) or the caller's sync/async context,
since that thread never drives any other tokio task.

* fix: restore documented b00t_ prefix on 5 core MCP tool names

Closes #827. Surfaced by the reverse-dependency-closure pre-push gate
when pushing an unrelated b00t-cli pipeline fix (b00t-mcp depends on
b00t-cli's pipeline types).

WhoamiCommand/StatusCommand/LearnCommand/McpListCommand/CliDetectCommand
were registered via impl_mcp_tool! without the "b00t_" prefix that:
- the macro's own doc comment uses as its example
  (impl_mcp_tool!(McpListCommand, "b00t_mcp_list", ...))
- every custom (non-macro) McpReflection impl already follows
  (BExecCommand -> "b00t_exec", BPipelineCommand -> "b00t_pipeline")
- two separate docs (b00t_quick_reference.md, b00t-mcp-cloudflare/
  README.md) document as the external, user-facing tool names

Since executors.get(tool_name) looks up whatever name an MCP client
actually requests, a client calling "b00t_whoami" per the documented
contract would have failed to find it in the registry before this fix
— a real, live defect, not just a test nit.

Also fixed test_tool_schema_generation, which asserted the pre-fix
unprefixed "mcp_list" and directly contradicted test_registry_creation's
"b00t_mcp_list" expectation (both assertions derive from the same
McpListCommand::to_mcp_tool() call, so they could never both pass).

cargo test -p b00t-mcp --lib: 51/51 pass (was 1 failure).
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.

2 participants