Commit Graph

1526 Commits

Author SHA1 Message Date
brent.edwards 5e595260b7 Merge pull request 'test(resource): add failing tests for built-in fs-directory type bootstrap (#537)' (#567) from feature/m3-test-resource-bootstrap-fs into master
Reviewed-on: cleveragents/cleveragents-core#567
2026-03-07 02:31:44 +00:00
brent.edwards ee59f8c2ab Merge branch 'master' into HEAD
# Conflicts:
#	CHANGELOG.md
2026-03-07 02:25:07 +00:00
brent.edwards 01ac466c2e Merge pull request 'test(cli): add failing tests for agents init --yes missing option (#536)' (#566) from feature/m3-test-init-yes-flag into master
Reviewed-on: cleveragents/cleveragents-core#566
Reviewed-by: Hamza Khyari <hamza.khyari@cleverthis.com>
2026-03-07 02:19:02 +00:00
brent.edwards 8c7497ddb3 Merge branch 'master' into HEAD
# Conflicts:
#	CHANGELOG.md
2026-03-07 02:09:56 +00:00
freemo fde8618665 docs(timeline): Day 26 PM sweep — schedule adherence, PR status, spec gap analysis
Day 26 (2026-03-06) comprehensive PM update:

- Schedule adherence entry with milestone forecasts and developer status
- Updated Current Status Summary: 272 issues closed (77%), 1570/1922 SP (82%)
- PR #617 (UKO Layer 1) and #611 (domain analyzers) merged late Day 26
- Open PR count: 19 -> 15 (merge rate exceeding new PR rate for first time)
- Spec gap analysis: no major coverage gaps found across all 44K-line spec
- All 15 open PRs have PM status comments with action items and deadlines
- Updated milestone roadmap, track forecasts, developer forecasts, risk summary
- Workstream and completion sections updated with Day 26 merges

ISSUES CLOSED: none (PM/docs update only)
2026-03-06 23:43:34 +00:00
hamza.khyari b157c05476 Merge pull request 'feat(acms): implement UKO Layer 1 Domain Ontologies (uko-code, uko-doc, uko-data, uko-infra)' (#617) from feature/m6-uko-layer1-domain-ontologies into master
Reviewed-on: cleveragents/cleveragents-core#617
Reviewed-by: Aditya Chhabra <aditya.chhabra@cleverthis.com>
2026-03-06 23:34:12 +00:00
hamza.khyari 44fae392d7 fix(acms): address self-review findings F1-F4 on PR #617
F1 [P1]: Split Turtle validation (125 lines) from ontology_registry.py
into _turtle_validation.py. Registry is now 412 lines (was 514).

F2 [P2]: Deduplicate DetailLevelMap presets — depth_breadth_projection.py
code_detail_map/docs_detail_map/database_detail_map/infra_detail_map now
delegate to ontology_registry.get_domain() instead of hardcoding level
dicts. Removes 112 lines of duplicated data.

F3 [P2]: Add __all__ to ontology_registry.py (18 exports, ruff-sorted).

F4 [P3]: Remove unused import logging / logger from ontology_registry.py.

Refs: #574
2026-03-06 23:26:35 +00:00
hamza.khyari 04f24b39c0 feat(acms): implement UKO Layer 1 Domain Ontologies (uko-code, uko-doc, uko-data, uko-infra)
Implement the four Layer 1 domain-specific OWL/Turtle ontology vocabularies
that specialize Layer 0 universal concepts for specific knowledge domains.

Ontology (docs/ontology/uko.ttl):
- Added uko-doc: namespace with 17 classes (Document, Part, Chapter, Section,
  Subsection, Paragraph, Sentence, CodeBlock, Citation, Figure, Table,
  Footnote, Annotation, Bookmark, CrossReference, PageBreak, SectionBreak),
  5 properties, and 4 relationships
- Added uko-data: namespace with 13 classes (Schema, Table, Column, View,
  StoredProcedure, Constraint, Index, ForeignKey, Trigger, Annotation,
  Bookmark, PartitionBoundary, ShardBoundary), 6 properties, and
  5 relationships
- Added uko-infra: namespace with 7 classes (Service, Network, Endpoint,
  ConfigKey, Volume, FirewallRule, SubnetBoundary) and 2 relationships
- All classes use rdfs:subClassOf from Layer 0 base classes

Domain registry (ontology_registry.py):
- DomainDescriptor dataclass with namespace IRI, prefix, layer, classes,
  superclass mappings, and DetailLevelMap
- Registry functions: get_domain(), list_domains(), get_layer1_domains()
- DetailLevelMap chain builder for hierarchical depth resolution
- Turtle validation with TurtleValidationError (no rdflib dependency)
- All DetailLevelMap data inlined to maintain DIP compliance (domain
  layer does not import from application layer)

DetailLevelMap presets (depth_breadth_projection.py):
- code_detail_map: 10 spec-complete levels (depths 0-9)
- docs_detail_map: 11 spec-complete levels (depths 0-10)
- database_detail_map: 12 spec-complete levels (depths 0-11)
- infra_detail_map: 9 spec-complete levels (depths 0-8)

Tests:
- 31 BDD scenarios in uko_ontology_registry.feature covering domain
  lookup, all DetailLevelMap levels, inheritance chains, Turtle
  validation, Universal View Guarantee, and negative/edge cases
- 6 Robot Framework integration tests
- Updated existing tests: depth_breadth_projection.feature (TABLE_LISTING
  depth 0->1, added SCHEMA_LISTING), uko_ontology.feature (Layer 1
  node count 8->67)

Spec reference: docs/specification.md §41830-42332

ISSUES CLOSED: #574
2026-03-06 23:14:30 +00:00
hamza.khyari 95c9c9f3a4 Merge pull request 'feat(acms): add PostgreSQL and Docker Compose domain analyzers' (#611) from feature/m6-acms-domain-specific-analyzers into master
Reviewed-on: cleveragents/cleveragents-core#611
Reviewed-by: Brent Edwards <brent.edwards@cleverthis.com>
2026-03-06 23:07:25 +00:00
brent.edwards dc1ecaab47 test(resource): add failing tests for built-in fs-directory type bootstrap
Add TDD-style Behave BDD tests for the built-in fs-directory resource type
bootstrap (bug #523). Three Gherkin scenarios: one failing TDD test
reproducing the bug (no bootstrap called during init, tagged @wip), and
two regression tests verifying bootstrap_builtin_types() seeds correct
data and resource add fs-directory succeeds after bootstrap. Includes
Robot Framework regression tests.

Review feedback addressed:
- Removed all 21 unnecessary # type: ignore comments (hurui200320 M1)
- Fixed is not True to is False for clarity (Aditya F2)
- Fixed Robot common.resource path to ${CURDIR}/common.resource (hurui200320 L1)
- Squashed all commits into one and rebased onto master (C1, C2)
- Added CHANGELOG entry with correct scenario count

Closes #537
2026-03-06 20:44:36 +00:00
hamza.khyari fb96d7910b fix(changelog): prepend #588 entry to top of Unreleased section (F8)
Move the (#588) CHANGELOG entry from after (#203) to the top of the
## Unreleased section, matching the convention that newest entries are
prepended first. All pre-existing entries (#473, #495, #203, #494)
remain intact and unmodified.

Addresses reviewer finding F8 from PR #611 second-pass review.
Refs: #588
2026-03-06 20:31:09 +00:00
brent.edwards 4e3bf7d3ad test(cli): add failing tests for agents init --yes missing option
Add TDD-style Behave BDD tests for the missing agents init --yes flag
(bug #522). Five Gherkin scenarios cover: exit code validation, prompt
suppression, -y alias, output summary fields, and interactive-mode
regression guard. Includes Robot Framework smoke tests (tagged @wip)
and ASV benchmarks.

Configure behave.ini to exclude @wip scenarios globally and noxfile.py
to exclude wip-tagged Robot suites, so TDD-failing tests do not break CI.

Review feedback addressed:
- Remove unnecessary # type: ignore from benchmark (outside Pyright scope)
- Fix Then...Then to Then...And in Gherkin (L1)
- Fix CHANGELOG 'three scenarios' to 'five scenarios' (L2)
- Add behave.ini documentation for @wip workaround (Aditya F1)
- Rename Scenario 2 title to 'suppresses interactive prompts' (Aditya F2)

Closes #536
2026-03-06 20:28:37 +00:00
hamza.khyari 13618fb8d5 fix(acms): address PR #611 review findings F1-F7
- F1/F2 [P1]: Split postgresql_analyzer.py (695→310 lines) by
  extracting regex patterns, URI builders, and parsing functions
  into _postgresql_helpers.py (440 lines).  Split
  domain_analyzers.feature (605→217 lines) into separate
  postgresql_analyzer.feature (201) and
  docker_compose_analyzer.feature (199).

- F3 [P1]: Fix _extract_body and _split_entries to track
  single-quoted SQL string literals so parentheses inside
  DEFAULT/CHECK values (e.g. 'func(x)') do not corrupt depth
  counting.  Added regression scenarios.

- F4 [P2]: Remove prohibited `# type: ignore[arg-type]` by
  adding a static protocol assertion for _DuplicatePyAnalyzer.

- F5 [P2]: Add 1 MiB size guard before yaml.safe_load in
  DockerComposeAnalyzer to mitigate billion-laughs alias
  expansion attacks.

- F6 [P2]: Fix quoted-keyword column names (e.g. "primary")
  being silently dropped by checking raw_first.startswith('"')
  before keyword filtering.  Added regression scenario.

- F7 [P2]: Out-of-scope file changes resolved by rebase onto
  master (changes already merged via other PRs).

All nox gates pass: lint (0 errors), typecheck (0 errors),
security_scan, behave (57 scenarios, 211 steps, 0 failures).
2026-03-06 20:07:03 +00:00
hamza.khyari 77db78d768 feat(acms): add PostgreSQL and Docker Compose domain analyzers (#588)
Add Phase 2 domain-specific analyzers for the ACMS UKO indexing pipeline:

- PostgreSQLAnalyzer: regex-based DDL parser extracting uko-data:Table,
  Column, ForeignKey, View, and Schema triples with column metadata
  (data type, nullability, primary key constraints).
- DockerComposeAnalyzer: YAML-based parser extracting uko-infra:
  DeploymentUnit, Service, Port, EnvironmentVariable, and connectsTo
  triples. Validates Compose format via services/version key detection.

Both satisfy AnalyzerProtocol and register in AnalyzerRegistry by file
extension (.sql/.ddl and .yml/.yaml respectively).

Includes 34 Behave BDD scenarios (protocol conformance, registry ops,
triple extraction for all 4 analyzers, error handling, cross-analyzer
URI scheme and confidence checks), 6 Robot Framework integration smoke
tests, updated __init__.py exports, vulture whitelist, and CHANGELOG.
2026-03-06 19:56:21 +00:00
CoreRasurae 23803f14ec feat(lsp): add LSP server stub
Added minimal LSP server entrypoint supporting initialize/shutdown/exit
handshake over JSON-RPC stdin/stdout transport with Content-Length
framing. Unsupported methods return MethodNotFound error with descriptive
message. Wired LSP requests through ACP facade in local mode. Added
agents lsp serve CLI command with --log-level flag, PID output, and
startup banner. Created reference documentation for the stub server.
Includes Behave BDD tests for protocol handshake, Robot smoke test, and
ASV startup latency benchmark.

ISSUES CLOSED: #203
2026-03-06 18:16:47 +00:00
aditya 2bf35e5403 Merge pull request 'feature/m6plus-event-bus' (#509) from feature/m6plus-event-bus into master
Reviewed-on: cleveragents/cleveragents-core#509
Reviewed-by: Hamza Khyari <hamza.khyari@cleverthis.com>
2026-03-06 13:29:03 +00:00
aditya 3d2b138379 Merge branch 'master' into feature/m6plus-event-bus 2026-03-06 12:44:37 +00:00
hurui200320 09d92ac67b test(e2e): validate M4 acceptance criteria for v3.3.0 milestone closure (#560)
## Summary

Validates all M4 acceptance criteria for v3.3.0 milestone closure. Adds CLI-exercising integration tests for the three subplan commands that lacked actual CLI invocation, fixes a pre-existing unit test failure, and corrects CONTRIBUTORS.md ordering.

## Changes

### New CLI Integration Tests (Robot Framework)

Three new test cases in `robot/m4_e2e_verification.robot` with helper functions in `robot/helper_m4_e2e_verification.py`:

| Test | CLI Command | Mocking Approach |
|------|-------------|-----------------|
| `CLI Plan Use Creates Plan With Subplan Config` | `plan use local/refactor-action local/monorepo` | Patches `_get_lifecycle_service`; mocks `get_action_by_name` + `use_action` |
| `CLI Plan Execute Transitions With Subplans` | `plan execute <plan_id>` | Patches `_get_lifecycle_service`; mocks `get_plan` + `execute_plan` |
| `CLI Plan Tree Displays Subplan Hierarchy` | `plan tree <plan_id> --format json` | Patches `get_container`; real `Decision` objects with `SUBPLAN_SPAWN`/`SUBPLAN_PARALLEL_SPAWN` types |

All three follow the same pattern as the existing `plan-diff` test: Typer `CliRunner.invoke()` with mocked services.

### Pre-existing Unit Test Fix

**File:** `features/steps/repositories_uncovered_branches_steps.py`
**Scenario:** `repo branch cov upsert profile with schema version mismatch` (line 110)
**Root cause:** Plain `sessionmaker` returns a new session per call. The `Given` step inserted via session A and committed session B (different session), so the `When` step's session C couldn't see the uncommitted data.
**Fix:** Changed to `scoped_session(sessionmaker(...))` so all factory calls return the same thread-local session.

### Other Fixes
- **CONTRIBUTORS.md**: Moved "Rui Hu" to correct alphabetical position (between Freeman and Khyari)
- **CHANGELOG.md**: Updated #495 entry to document CLI test additions

## M4 Acceptance Criteria Verification

All 7 criteria exercised by 10 E2E tests (7 existing + 3 new) + 8 smoke tests:

| # | Criterion | Test(s) | Status |
|---|-----------|---------|--------|
| 1 | Subplans spawned during Execute via SubplanConfig | `spawn-subplans`, **`cli-plan-use`**, **`cli-plan-execute`** | PASS |
| 2 | Parallel execution with max_parallel bounds | `parallel-exec` | PASS |
| 3 | Three-way merge combines non-conflicting changes | `merge-clean` | PASS |
| 4 | Merge conflicts surfaced with git markers | `merge-conflict` | PASS |
| 5 | Parent plan tracks subplan statuses | `parent-tracking` | PASS |
| 6 | Plan tree displays subplan hierarchy | `plan-tree`, **`cli-plan-tree`** | PASS |
| 7 | Plan diff shows merged results | `plan-diff` (already uses CLI) | PASS |

## Quality Gates

| Stage | Result |
|-------|--------|
| lint | pass |
| format | pass (1074 files unchanged) |
| typecheck | pass (0 errors) |
| unit_tests | 8524 scenarios, 0 failures |
| integration_tests | 1110/1118 pass (8 pre-existing failures in `cli_plan_context_commands.robot`, identical on master) |
| coverage_report | 97% (threshold: 97%) |
| security_scan | pass |
| dead_code | pass |
| docs | pass |
| build | pass |
| benchmark | pass |

## Files Changed

- `CHANGELOG.md` — Updated #495 entry
- `CONTRIBUTORS.md` — Fixed alphabetical ordering
- `features/steps/repositories_uncovered_branches_steps.py` — `scoped_session` fix
- `robot/helper_m4_e2e_verification.py` — 3 new helper functions + imports
- `robot/m4_e2e_verification.robot` — 3 new test cases

ISSUES CLOSED: #495

Reviewed-on: cleveragents/cleveragents-core#560
Reviewed-by: Luis Mendes <luis.mendes@cleverthis.com>
Co-authored-by: Rui Hu <rui.hu@cleverthis.com>
Co-committed-by: Rui Hu <rui.hu@cleverthis.com>
2026-03-06 03:22:45 +00:00
hamza.khyari 1a54dd2d2f Merge pull request 'feat(acms): add scoped backend view filtering' (#607) from feature/m6-acms-scoped-view into master
Reviewed-on: cleveragents/cleveragents-core#607
Reviewed-by: Brent Edwards <brent.edwards@cleverthis.com>
2026-03-06 00:54:59 +00:00
hamza.khyari b028c80cab feat(acms): add scoped backend view filtering
Add project-resource isolation to the ACMS context tier system via
ScopedBackendView, ResourceScope, alias resolution, DAG expansion,
and enforcement hooks.

Core types (scoped_view.py): ResourceScope, ScopeViolationError,
ScopedBackendView, ScopedBackendSet, create_scoped_backend_set.

Scope resolution (scope_resolution.py): ResourceAliasResolver,
validate_project_scope, validate_resource_scope, resolve_resource_scope
with registry_lookup callback for DAG expansion.

Tier integration (scoped_tiers.py): ScopedTierMixin with get_scoped,
get_scoped_by_resource, validate_fragment_scope, store_with_scope_check,
get_scoped_metrics mixed into ContextTierService.

Backward compat: tiers.py re-exports ScopedBackendView.

Tests: 74 Behave scenarios (235 steps), 8 Robot Framework cases,
7 ASV benchmark suites. Lint and typecheck clean.

ISSUES CLOSED: #193
2026-03-06 00:49:33 +00:00
brent.edwards b5915feb6b Merge pull request 'ci(opencode.json): add file from Luis's suggestions' (#609) from feature/following-luis-suggestion into master
Reviewed-on: cleveragents/cleveragents-core#609
Reviewed-by: Luis Mendes <luis.mendes@cleverthis.com>
2026-03-05 23:49:44 +00:00
brent.edwards d2a8ead45c Merge branch 'master' into feature/following-luis-suggestion 2026-03-05 23:44:42 +00:00
hamza.khyari f0708c8d05 Merge pull request 'feat(acms): add context strategy registry with plugin discovery' (#565) from feature/m6-acms-strategy-registry into master
Reviewed-on: cleveragents/cleveragents-core#565
Reviewed-by: Brent Edwards <brent.edwards@cleverthis.com>
2026-03-05 23:40:17 +00:00
brent.edwards 50458d1c9f ci(opencode.json): change based on Luis's comments 2026-03-05 23:39:16 +00:00
brent.edwards d4acd05dbf ci(opencode.json): add file from Luis's suggestions
https://matrix.to/#/!ZuWYQzDEGWoZeNbfFB:qoto.org/$sLRMR8jNmeXw6FGpwqwG_Kp9PVus4SwlApmCtboYetk?via=qoto.org&via=matrix.org
2026-03-05 23:18:08 +00:00
brent.edwards f4a6660bad fix(test): fix _capture_output to treat SystemExit(0) as success (TEST-4)
SystemExit(0) and SystemExit(None) are normal termination, not
failures. Only set failed=True when exit code is non-zero.
2026-03-05 22:02:32 +00:00
brent.edwards 5733ab4045 fix(test): add tags = ~@wip to behave.ini to exclude @wip scenarios
Addresses BUG-4 from hamza.khyari Round 2 review: @wip scenarios
broke `nox -s unit_tests` because behave.ini had no wip exclusion.
2026-03-05 22:02:05 +00:00
hamza.khyari b7effcafc1 fix(acms): address PR #565 review findings from CoreRasurae
Resolve 14 review findings across bugs, spec deviations, design gaps,
security, performance, thread safety, and test quality:

- Fix register() guard ordering: isinstance check before attribute access
- Add BackendSet.temporal field for cold-tier backend availability
- Fix temporal-archaeology/plan-decision-context can_handle to require
  temporal backend (spec §43193-43199)
- Add threading.RLock to StrategyRegistry for thread safety
- Add allowed_module_prefixes (CWE-706) to register_from_module
- Change StrategyConfig.extra and ContextStrategyResult.stats to
  MappingProxyType with field_validator coercion (ADR-004 immutability)
- Switch 6 stub capabilities from @property to @functools.cached_property
- Add resource_types/extra params to update_config()
- Add inject_stale_enabled_entry() public test helper
- Rename colliding step patterns to avoid AmbiguousStep with master
- Add scenarios: non-protocol without name, concurrent threads,
  temporal backend regression tests
- Document spec §25223 vs §28682 conflict and colon vs dot notation
2026-03-05 22:00:15 +00:00
khyari hamza 1521c4ae8c feat(acms): add context strategy registry
Implement the ACMS context strategy registry per spec §25162-25233,
§28682-28708, §42628-42653, and §43167-43199.

- Define ContextStrategy protocol, StrategyCapabilities, BackendSet,
  PlanContext, StrategyConfig, ContextStrategyResult models
- Add 6 built-in stub strategies (simple-keyword, semantic-embedding,
  breadth-depth-navigator, arce, temporal-archaeology,
  plan-decision-context) with spec quality scores and feature flags
- Add StrategyRegistry with register, register_from_module (plugin
  discovery), enable/disable, per-strategy config, and validation
- Add ContextStrategyResult with deterministic fragment ordering
  (-relevance_score, uko_node)
- Add configuration-driven enabled list with per-project overrides
- Add per-strategy timeout, max-fragment, circuit-breaker config
- Add registry validation for resource types and backend capabilities
- Fix update_config to sync _enabled_order when toggling enabled flag
- Fix register_from_module to honour the name parameter as registry key
- Fix update_config to re-run Pydantic validators via model_validate
- Add docs/reference/context_strategies.md
- Add 55 BDD scenarios (Behave), 4 Robot integration tests,
  ASV benchmarks

ISSUES CLOSED: #191
2026-03-05 22:00:15 +00:00
brent.edwards 0dfcdc641f Merge branch 'master' into feature/m3-test-resource-bootstrap-git 2026-03-05 21:54:22 +00:00
freemo fae438a7a7 refactor(acms): unify ContextFragment model hierarchies by extending CRP base types
Core domain types (FragmentProvenance, ContextFragment, ContextBudget,
ContextPayload) now extend their CRP counterparts via Pydantic v2
inheritance, ensuring isinstance compatibility across the model
hierarchy.

Key changes:
- CRP base types made frozen=True (no consumer mutates them)
- CRP AssembledContext fields changed from list to tuple (frozen consistency)
- Core types extend CRP bases: FragmentProvenance(CRPFragmentProvenance),
  ContextFragment(CRPContextFragment), ContextBudget(CRPContextBudget),
  ContextPayload(CRPAssembledContext)
- Removed duplicate ContextFragment dataclass from skeleton_compressor
- Updated project_context.py to pass tuples to frozen AssembledContext
- Added Behave tests (10 scenarios), Robot integration tests (3 cases),
  and ASV benchmarks for the unified hierarchy
- Updated Known Limitations table in docs/reference/acms.md

ISSUES CLOSED: #569
2026-03-05 21:38:55 +00:00
brent.edwards 7b3743f9bf Merge branch 'master-latest' into feature/m3-test-resource-bootstrap-git
# Conflicts:
#	CHANGELOG.md
2026-03-05 20:46:01 +00:00
brent.edwards 63764d68eb fix(test): address hamza.khyari review #1986 findings on git-checkout bootstrap tests
- SPEC-1: Added genuine TDD failing Scenario 1 (@wip) that creates registry
  WITHOUT bootstrap and asserts git-checkout exists — reproduces bug #524.
  Existing scenarios retained as regression tests (no @wip since they pass).
  Added NOTE FOR FIX AUTHOR comment documenting fix-path expectations.
- BUG-1: Removed colliding @when('I run "agents resource add..."') step.
  Replaced with uniquely-prefixed bootstrap-git step pattern that invokes
  resource_add() directly with mocked DI, avoiding AmbiguousStep collision
  with wildcard @when('I run "{command}"') in cli_plan_context_commands_steps.
- BUG-2: Removed duplicate @then('the CLI exit code should be {code:d}').
  Replaced with prefixed bootstrap-git assertion steps.
- BUG-3: Removed duplicate @then('the CLI output should not contain...").
  Replaced with prefixed bootstrap-git assertion steps.
- TEST-1: Replaced bare MagicMock() with direct service patching via
  _PATCH_SERVICE, consistent with PR #567 pattern.
- TEST-2: Updated Robot docs from 'expected to FAIL' to 'regression tests'
  since both Robot tests call bootstrap explicitly and pass.
- CODE-1: Simplified hasattr guards on enum fields — removed redundant
  hasattr checks, using .value directly since ResourceKind and
  SandboxStrategy are always enums.
- TEST-3: Added assertion on bootstrap_builtin_types() return value via
  new Then step 'the bootstrap-git registered types should include'.
- Updated CHANGELOG from 'Two scenarios' to 'Three scenarios'.

Refs: #553
2026-03-05 20:36:05 +00:00
freemo d990fc1b41 feat(uko): add analyzer plugin framework and initial domain analyzers
Implemented the analyzer plugin framework with AnalyzerProtocol,
AnalyzerRegistry for registration/discovery by file extension,
PythonAnalyzer (AST-based extraction of modules, classes, functions,
imports, docstrings), and MarkdownAnalyzer (section, code block, and
link extraction). Both analyzers produce well-formed UKO triples with
proper URI schemes.

ISSUES CLOSED: #551
2026-03-05 19:20:39 +00:00
freemo 1d15eca866 feat(acms): implement depth/breadth projection system
Add the Depth/Breadth Projection System and Skeleton Context
Propagation as specified in docs/specification.md §25265-25340
and §43057-43128:

- ProjectionSpec: frozen Pydantic model capturing a projection
  request (focus, breadth, depth, gradient, domain)
- ProjectedNode: frozen model for materialized graph nodes with
  resolved depth and distance
- DepthBreadthProjector: stateless BFS projector over UKO graph
  adjacency with depth gradient (linear reduction by distance)
- PlanContextInheritance: service computing child plan context
  from parent assembled context with skeleton injection
- ChildContextResult: frozen result model with request and skeleton
- InheritanceConfig: frozen config for skeleton_ratio (default 0.2)
- Built-in DetailLevelMap presets for code, docs, and database

Includes 27 Behave BDD scenarios, 9 Robot Framework integration
tests, and ASV benchmarks for all components.

ISSUES CLOSED: #544
2026-03-05 15:42:20 +00:00
freemo 81a12f6b36 Docs: Fixed navbar in documentation 2026-03-05 10:39:24 -05:00
freemo fe7381c45b feat(acms): implement pipeline Phase 2 components
Add production-grade Phase 2 (Fragment Fusion) components for the ACMS
context assembly pipeline, replacing the no-op defaults:

- ContentHashDeduplicator: Groups fragments by UKO node URI, hashes
  content to detect duplicates, retains highest relevance_score.
- MaxDepthResolver: Resolves depth conflicts by keeping the highest
  detail depth per UKO node, with relevance tiebreaking.
- WeightedCompositeScorer: Computes composite score from configurable
  weighted factors (relevance=0.4, hierarchy=0.3, quality=0.2,
  recency=0.1). Stores component breakdown in metadata.
- GreedyKnapsackPacker: Greedy knapsack selection with depth fallback
  (tries depths [9,4,2,0] for oversized fragments) and minimum
  fragment token threshold (10).

Also adds:
- ScoredFragment frozen Pydantic model (spec §42825) with
  composite_score, score_components, and fragment reference
- score_detailed() method on WeightedCompositeScorer returning
  ScoredFragment objects for callers needing full breakdowns
- All components implement v1 Protocol signatures from acms_service.py
  and can be DI-injected into ACMSPipeline constructor

Testing:
- 31 Behave BDD scenarios in acms_pipeline_phase2.feature covering
  deduplication, depth resolution, scoring, packing, depth fallback,
  budget constraints, pipeline integration, and ScoredFragment model
- 6 Robot Framework integration smoke tests
- ASV benchmark suites for all 4 components and ScoredFragment

Quality gates: lint, typecheck (0 errors), unit_tests (8555 scenarios),
coverage (97.0%), dead_code — all passing.

ISSUES CLOSED: #540
2026-03-05 10:27:36 -05:00
freemo 34f9a587cf feat(acms): implement pipeline orchestrator and Phase 1 components
Add production-quality Phase 1 pipeline components for the ACMS
Context Assembly Pipeline:

- ConfidenceWeightedSelector: strategy selection with preference
  boosting and confidence-based ranking
- ProportionalBudgetAllocator: proportional token budget distribution
  with min_useful_budget enforcement and largest-remainder rounding
- ParallelStrategyExecutor: concurrent strategy execution via
  ThreadPoolExecutor with per-strategy timeouts and circuit breaking
- CircuitBreaker: per-strategy failure tracking with configurable
  threshold and explicit reset
- ContextAssemblyPipeline: extends ACMSPipeline with Phase 1
  production components and per-stage timing (StageTimings)

Includes 28 Behave BDD scenarios, 9 Robot Framework integration tests,
and ASV benchmarks for all components.

ISSUES CLOSED: #539
2026-03-05 15:13:19 +00:00
hurui200320 cb1403c24d test(e2e): validate M3 acceptance criteria for v3.2.0 milestone closure (#559)
## Summary

Validates all 10 M3 (v3.2.0) acceptance criteria via the E2E verification suite. This is the final gate before closing milestone v3.2.0.

### Single Commit (Squashed per CONTRIBUTING.md)

Branch history was squashed from 2 commits into 1 (`e1665c6e`) to comply with the one-commit-per-issue rule. The single commit includes:

1. **Original work**: Suite-level Force Tags, per-test acceptance criteria tags, enhanced documentation with milestone cross-references, CHANGELOG and CONTRIBUTORS entries.
2. **Review feedback fixes** (addressing Luis's CRITICAL/HIGH findings): Replaced fixture-self-assertion patterns with real CLI-path validation for all 10 acceptance criteria, added persistence-backed decision tree checks, robust JSON output parsing, explicit Robot process timeouts, and clearer correction tags.
3. **Rebase onto current master** (`fff6bb38`): Clean rebase resolving CHANGELOG conflict, as requested by PM (freemo).
4. **Bug fix — `async_enabled` attribute**: `PlanLifecycleService.execute_plan()` accesses `self.settings.async_enabled` (`plan_lifecycle_service.py:283`). The test helper's `_make_settings()` used `create_autospec(Settings)` but didn't set this attribute, causing `plan execute` CLI tests to fail with `AttributeError`. Fixed by adding `settings.async_enabled = False`.
5. **Timeout fixes for parallel execution**: When `pabot` runs 16 parallel Robot processes, cold-start import times + Alembic migrations cause 30s timeouts to be insufficient. Increased timeouts from 30s to 120s in 3 robot files: `actor_context_management.robot`, `decision_di_wiring_smoke.robot`, `changeset_persistence.robot`.

### Files Changed (7)

| File | Change |
|------|--------|
| `robot/helper_m3_e2e_verification.py` | Rewritten for real CLI-path validation; `_make_settings()` fixed with `async_enabled = False` |
| `robot/m3_e2e_verification.robot` | Force Tags, per-test tags, timeouts, enhanced docs |
| `robot/actor_context_management.robot` | Timeout 30s → 120s (line 92) |
| `robot/decision_di_wiring_smoke.robot` | Timeout 30s → 120s (lines 14, 21) |
| `robot/changeset_persistence.robot` | `${TIMEOUT}` 30s → 120s (line 12) |
| `CHANGELOG.md` | Entry for #494 |
| `CONTRIBUTORS.md` | Added Rui Hu |

### Acceptance Criteria Verified (10/10)

**Success Criteria:**
- `plan use` + `plan execute` generates decisions during Strategize
- `plan tree` displays decision tree correctly (via CLI invocation)
- `plan explain` shows full decision context (via CLI invocation)
- `invariant add --project` / `invariant list --project` work with project scope
- `plan correct --dry-run` performs impact analysis (via CLI invocation)
- `plan correct --mode=revert` executes live correction (via CLI invocation)

**Technical Criteria:**
- Decisions recorded with full context snapshot
- Decision tree persists to database and renders correctly
- Correction in revert mode re-executes from decision point
- Invariants enforced during strategize

### Quality Gates (Full Nox Suite)

| Session | Result | Details |
|---------|--------|---------|
| `lint` | PASS | ruff clean |
| `format` | PASS | ruff format clean |
| `typecheck` | PASS | pyright 0 errors, 0 warnings |
| `security_scan` | PASS | bandit clean |
| `dead_code` | PASS | vulture clean |
| `unit_tests` | PASS | 8500 BDD scenarios, 0 failures |
| `integration_tests` | PASS | 1194/1194 tests, 0 failures |
| `docs` | PASS | mkdocs build clean |
| `build` | PASS | wheel built |
| `benchmark` | PASS | performance benchmarks pass |
| `coverage_report` | PASS | 96.96% → rounds to 97% (meets `--fail-under=97`) |

Closes #494

Reviewed-on: cleveragents/cleveragents-core#559
Reviewed-by: Luis Mendes <luis.mendes@cleverthis.com>
Co-authored-by: Rui Hu <rui.hu@cleverthis.com>
Co-committed-by: Rui Hu <rui.hu@cleverthis.com>
2026-03-05 15:09:19 +00:00
freemo 10abf8985e feat(acms): add ContextFragment and ScoredFragment data models
Created ScoredFragment frozen model wrapping ContextFragment with
composite_score, score_breakdown, and rank fields. Added pipeline-
specific fragment models in domain/contexts/ with proper equality
based on uko_uri + detail_depth for deduplication support.

ISSUES CLOSED: #538
2026-03-05 14:11:23 +00:00
freemo 487e16a9f0 feat(acms): implement context strategies batch 1
Implement the first three built-in context strategies for the ACMS v1
context assembly pipeline:

1. SimpleKeywordStrategy (quality 0.3) - Keyword matching on fragment
   content with word-density fallback. Universal fallback strategy.
2. SemanticEmbeddingStrategy (quality 0.6) - Jaccard word-overlap
   similarity scoring between query and fragment content.
3. BreadthDepthNavigatorStrategy (quality 0.85) - UKO node hierarchy
   navigation prioritising fragments near focus nodes with higher
   detail depths. Primary strategy for code projects.

All strategies implement the v1 ContextStrategy Protocol from
acms_service.py and can be registered with ACMSPipeline via
register_strategy().

Includes:
- 28 Behave BDD scenarios covering ranking, budget, capabilities,
  can_handle confidence, explain, empty input, and pipeline
  registration
- 9 Robot Framework integration tests
- ASV benchmarks at 10/100/1000 fragment scales for all 3 strategies
- Vulture whitelist entries for public API symbols
- 100% coverage on context_strategies.py

ISSUES CLOSED: #541
2026-03-05 12:58:57 +00:00
aditya fff6bb3833 Merge pull request 'feat(actor): add plan_subplan tool and decision emission' (#463) from feature/m5-subplan-actor into master
Reviewed-on: cleveragents/cleveragents-core#463
Reviewed-by: Hamza Khyari <hamza.khyari@cleverthis.com>
2026-03-05 07:12:21 +00:00
aditya 7ab5d8661a Merge branch 'master' into feature/m5-subplan-actor 2026-03-05 06:35:45 +00:00
freemo f40e76ad8e Docs: Daily update to timeline 2026-03-04 22:47:38 -05:00
hamza.khyari 8764fbed7b Merge pull request 'feat(acms): add ACMS v1 context pipeline' (#465) from feature/m5-acms-context into master
Reviewed-on: cleveragents/cleveragents-core#465
2026-03-05 01:33:54 +00:00
khyari hamza febea8950f feat(acms): add ACMS v1 context pipeline
Implement the 10-component pluggable ACMS context assembly pipeline
with three built-in strategies (relevance, recency, tiered), DI-based
component injection, ULID-validated plan_id, largest-remainder budget
allocation, and frozen Pydantic v2 domain models.

Closes #188
2026-03-05 01:28:50 +00:00
brent.edwards 6b59c2f58c Merge branch 'master' into feature/m3-test-resource-bootstrap-git 2026-03-04 23:52:38 +00:00
CoreRasurae 837ff4217b feat(async): add async command execution and workers
- Add AsyncJob domain model with status state machine and Pydantic validation
- Add AsyncWorker service with configurable concurrency and job store
- Add CancellationToken, WorkerHealthReport, InMemoryJobStore
- Add AsyncJobModel SQLAlchemy model and Alembic migration (m6_003)
- Add 5 async config keys to Settings (worker_id, concurrency, poll_interval, max_retries, timeout)
- Add _check_async_worker_health diagnostic check in system.py
- Add comprehensive Behave BDD tests (~60 scenarios) with full step definitions
- Add Robot Framework integration tests (6 smoke tests)
- Add ASV benchmark suite for async execution
- Add architecture documentation
- Update vulture_whitelist with new public API symbols
- All quality gates pass: lint, typecheck, unit_tests, integration_tests, coverage_report (97%)

1. Wire async job creation into PlanLifecycleService:
   - Add optional job_store parameter to __init__
   - Add _maybe_enqueue_async_job() helper that checks settings.async_enabled
     and job store presence before creating and enqueuing an AsyncJob
   - Call helper from execute_plan() (phase="execute") and apply_plan()
     (phase="apply") after phase transitions
   - When async is disabled or no job store is configured, behaviour is
     unchanged (silent no-op)

2. Redact secrets in failed job error messages:
   - Apply shared.redaction.redact_value() to the error string before
     persisting to AsyncJob.error_message, preventing accidental secret
     leakage (e.g. API keys in exception text) into the audit trail

Documentation:
- S1: Added specification reconciliation note (ADR-style) to
  async_architecture.md addressing tension between "No Plan Queuing"
  clause and the async subsystem authorised by issue #312

ISSUES CLOSED: #312
2026-03-04 23:47:20 +00:00
brent.edwards 7b86008cfc Merge branch 'master' into feature/m3-test-resource-bootstrap-git 2026-03-04 22:48:56 +00:00
khyari hamza ad53a659de feat(uko): add UKO ontology scaffolding
Add UKO Layer 0-3 ontology skeleton (RDF/TTL) with base URI, version IRI,
and prefix conventions. Python loaders handle URI parsing, inheritance
resolution, versioning metadata, and validation of undefined prefixes and
missing rdf:type. Includes Behave BDD scenarios, Robot Framework integration
tests, ASV benchmarks, and reference documentation.

- Resolve rdfs:domain and rdfs:range values to full URIs in parser
- Fix type: ignore in Robot helper with proper Callable typing
- Export UKO models from core/__init__.py
- Add parent-URI existence validation in validate()
- Rename scenario to clarify parser-skips vs validation-rejects
- Add scenario testing validation with injected typeless node
- Add Scenario Outline for multi-layer node count assertions

- TTL: Layer 0 classes (InformationUnit, Container, Atom, Annotation,
  Boundary) with contains/references/dependsOn properties. Layer 1
  uko-code: classes (Module, Callable, TypeDefinition, TestCase, Import)
  with hasReturnType/hasParameters/testsCallable. Layer 2 uko-oo: classes
  (Class, Interface, Method, Attribute) with inheritsFrom/implements and
  rdfs:subPropertyOf. New URI scheme cleveragents.ai/ontology/uko#.
- TTL: uko-oo:Class has dual rdfs:subClassOf (TypeDefinition + Container),
  uko-oo:Interface has dual rdfs:subClassOf (TypeDefinition + Boundary).
- Model: UKONode.parent_uri replaced with parent_uris: tuple[str, ...]
  to support multi-parent rdfs:subClassOf.
- Loader: prefix regex supports hyphenated names (uko-code, uko-oo).
  Semantic domain prefix maps (_LAYER_PREFIXES, _LAYER_IRI_PREFIXES).
  Comma-separated rdfs:subClassOf parsing. rdfs:domain/range/subPropertyOf
  URI resolution. BFS DAG traversal with DFS cycle detection for
  resolve_inheritance. HTTP URI skip in validation (D-1 fix). Duplicate
  error guard (B-1 fix). Consistent quoting (M-1 fix).
- Services __init__: export UKOLoader and UKOValidationError.
- Tests: 24 Behave scenarios (multi-parent, domain/range resolution,
  non-existent parent validation). 4 Robot smoke tests. Consolidated
  context attributes (T-3 fix).
- Docs: uko.md written for spec-aligned structure.

- Namespace prefix match in parent-URI validation includes a
delimiter guard (# or /) preventing false positives on URIs that share
the UKO prefix string (e.g. ukobogus:, ukoo:).

ISSUES CLOSED: #189
2026-03-04 22:40:34 +00:00