Skip to content

feat(planning): add bounded semantic planner - #6

Merged
HayronHgh merged 2 commits into
mainfrom
agent/bounded-semantic-proposal-generation
Aug 9, 2026
Merged

feat(planning): add bounded semantic planner#6
HayronHgh merged 2 commits into
mainfrom
agent/bounded-semantic-proposal-generation

Conversation

@HayronHgh

@HayronHgh HayronHgh commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

Implements 0.2.0-dev.4 — M4 Bounded Semantic Proposal Generation.

  • build a deterministic, globally bounded PlannerInventoryView from Runtime-owned inventory facts
  • add an isolated, tool-free Qwen planner using the versioned planner-v1 prompt
  • disable Qwen thinking for the planner request while accepting only final message.content
  • pass raw output through the frozen strict M2 parser, plan-ID challenge, inventory binding, and visible-unit binding
  • invoke the unchanged M3 Runtime Validator and stop at ValidatedPlan
  • add bounded retry/fallback behavior, session-only audit events, PAR/IPR and proposal telemetry
  • add bilingual documentation, fixtures, fake-client tests, and a real llama.cpp/Qwen smoke test

Freeze-gate observability corrections

  • result-level input/output tokens and latency are cumulative across all Planner attempts
  • attempt audit events retain per-request token values
  • parseFailures counts only malformed JSON, schema violations, and duplicate decisions
  • failures are separated into protocol, binding, visibility, client, and stale categories
  • planner-v1 now states the complete importance enum, non-empty reason rule, and positive targetTokens rule
  • fake-client regressions cover cumulative retry cost and each failure class

Safety boundary

This PR intentionally does not add:

  • context mutation or lifecycle/authority mutation
  • Transformer or Executor
  • artifact creation or memory promotion
  • actual token-savings claims
  • changes to ContextManager, AgentRuntime, or the M3 Validator policy
  • validator-aware autonomous replanning

Hidden units remain implicit KEEP. Stale inventories are discarded without retry. Validator rejection stops and requires deterministic fallback.

Validation

  • npm test: 111 passed, 1 Windows symlink-permission skip
  • targeted planner/client tests: 16 passed
  • JavaScript syntax checks: 36 files
  • Markdown link checks: 28 files
  • git diff --check: clean
  • frozen boundary diff against main: no changes to ContextManager, AgentRuntime, MemoryStore, tool evidence, or Validator
  • real local llama.cpp b10295 + Qwen3.6 E2E: V020_M4_E2E_OK

With the complete schema wording, the real Qwen smoke test passed the strict protocol on its first attempt (parseAttempts: 1, zero categorized failures). The unchanged M3 Validator then rejected one non-recoverable proposal and stopped with deterministic fallback and no mutation.

Follow-up invariant

M5 must revalidate recovery-source existence and integrity immediately before any future transformation or execution.

@HayronHgh
HayronHgh marked this pull request as ready for review August 9, 2026 17:11
@HayronHgh
HayronHgh merged commit aa59f4d into main Aug 9, 2026
4 checks passed
@HayronHgh
HayronHgh deleted the agent/bounded-semantic-proposal-generation branch August 9, 2026 17:11
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.

1 participant