Skip to content

feat(btw): extract the rule-based classifier experiment - #146

Draft
YUZHEthefool wants to merge 18 commits into
masterfrom
experiment/btw-rule-classifier
Draft

YUZHEthefool wants to merge 18 commits into
masterfrom
experiment/btw-rule-classifier

Conversation

@YUZHEthefool

@YUZHEthefool YUZHEthefool commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

Extract the prototype's deterministic rule classifier, its opt-in conversation hook, and tests as a standalone experimental candidate. Explicit /work admission bypasses classifier rules.

Related issue

Related: #133
Parent: #122
Design: #28

Stack

  • Base: split/btw-skill-routes. Depends on PR #145.
  • Sibling experiments on the same base: #147, #148. These are alternatives, not dependencies.
  • Tested shared baseline: 54987c857178edae1c169f63f795fefbe169d3d0.

Behavior

Implement and evaluate only the rule-based candidate in its own experimental PR. Start with the prototype's frozen rules and run the shared dataset and capability fixtures before considering targeted changes.

Implementation notes

A separate model call, conversation-owned model routing, production default changes, and a multi-classifier switch framework are outside this candidate PR.

Experiment status

Base branch: split/btw-skill-routes. Depends on PR #145. This PR shows only this feature's changes relative to that dependency. The original prototype at 33ee103a62937db3e930c89ba47a648b75cc7772 is provenance; integration follows current master's owners and authorization contracts. The parent issue records review/integration order.

This is one of three sibling draft PRs on the same feature baseline. Candidate-specific missing work is listed below; the documentation-only experiment drafts do not claim an implemented classifier.

Validation

132 tests passed across nine relevant suites, including classifier rules, explicit admission, detached concurrent work, and real metadata conversion. The CI quality Pyright project passed using the Linux platform model, and the VitePress build passed. Final rebasing changed only the inherited six Chinese strings: all 9 metadata tests, Ruff and locale Prettier passed again; implementation/tests/docs remained identical to the validated candidate.

Commands run from the feature worktree (using the existing Python environment):

python -m pytest tests/unit/test_btw_task_classifier.py tests/unit/test_conversation_loop.py tests/unit/test_btw_work_loop.py tests/unit/test_btw_delivery.py tests/unit/test_config_metadata_i18n.py tests/unit/test_process_stage.py tests/unit/test_btw_status.py tests/unit/test_builtin_command_extensions.py tests/unit/test_core_import_smoke.py --basetemp=.tmp/pytest-r1-final-integration -q
pyright --project pyrightconfig.quality.json --venvpath D:/project/Zephirum --pythonplatform Linux
python -m pytest tests/unit/test_config_metadata_i18n.py --basetemp=.tmp/pytest-r1-final-metadata -q
# docs/
pnpm run docs:build

Python checks used the existing Python 3.14.1 environment with python -m pytest and task-local --basetemp directories. Local Node was 24.11.1; CI must validate the pinned toolchain. Relevant scoped formatting and Markdown checks were run. The root tracker records the final combined validation. No live model evaluation is implied by deterministic tests or documentation checks.

Compatibility and risk

Draft experiment. Rules remain disabled by default. Shared evaluation corpus, comparative measurements and acceptance thresholds are still required before product adoption; passing deterministic tests does not select this candidate.

Checklist

  • A corresponding development Issue exists and this PR contains one feature or experiment.
  • Tests and bilingual documentation accompany the change, or missing experimental implementation is explicitly described.
  • Existing authorization, current APIs/configuration, Python 3.14+, and integrated documentation constraints are retained.
  • No dependencies, credentials, generated site output, or fork publication claims are introduced.
  • A human maintainer review and separate AI-assisted review have approved merging.

Repository references: AGENTS.md, GOVERNANCE.md, AI_POLICY.md, and the feat PR template.

Agent note

Codex prepared this PR at the user's request to split the original #28 implementation into reviewable features, with only classifier experiments marked as drafts. AI assisted extraction, current-path adaptation, tests, and English descriptions. The validation above was performed locally; remaining limitations are stated explicitly. This note is not a maintainer approval. No PR has been merged.

Reuse the existing Agent executor with bounded execution concurrency,
terminal retention, cancellation propagation and generic failure state.

Related: #125
AI-Generated: true
Generated-At: 2026-09-10T15:34:43Z
Keep request-scoped WebChat delivery open until work completes and
reclaim profile tasks before their runtime dependencies close.

Related: #126
AI-Generated: true
Generated-At: 2026-09-10T15:51:37Z
Extract the GreedyStr work entry from PR #28 through the current command
schema and public SDK. Keep empty input and status reserved for the
separate status-query slice; task submission needs both loop switches.

Fixes #124
AI-Generated: true
Generated-At: 2026-09-10T16:01:19Z
Extract status queries from PR #28 through a lazy SDK read helper.
Bind managers to initialized profile pipelines and remove only the closing
pipeline's registration. Keep queries scoped to the profile and origin.

Fixes #127
AI-Generated: true
Generated-At: 2026-09-10T16:09:51Z
Keep the work enablement, concurrency, and retention controls inside the
converted BTW section, and verify their existing bilingual keys.

AI-Generated: true
Generated-At: 2026-09-10T16:19:37Z
Await the dynamically discovered close hook through its awaitable contract.
Bring the corrected Dashboard section and control coverage into delivery.

AI-Generated: true
Generated-At: 2026-09-10T16:23:30Z
Bring the corrected Dashboard metadata section and typed scheduler closure
into the explicit work submission branch without rewriting its history.

AI-Generated: true
Generated-At: 2026-09-10T16:24:35Z
Carry the Dashboard metadata structure and scheduler awaitable fixes into
the status branch while retaining the published feature history.

AI-Generated: true
Generated-At: 2026-09-10T16:26:29Z
Restore the six work enablement, concurrency, and retention translations
from their runtime metadata descriptions and hints.

AI-Generated: true
Generated-At: 2026-09-10T16:37:36Z
Carry the corrected work runtime translations into the delivery branch.

AI-Generated: true
Generated-At: 2026-09-10T16:38:18Z
Carry the corrected work runtime translations into the command branch.

AI-Generated: true
Generated-At: 2026-09-10T16:39:25Z
Carry the corrected work runtime translations into the status branch.

AI-Generated: true
Generated-At: 2026-09-10T16:40:43Z
Extract the loop-specific model settings from the original PR #28 prototype.
Preserve session selection when a loop override is empty or BTW is disabled.

Fixes #128
AI-Generated: true
Generated-At: 2026-09-10T15:25:34Z
Extract Computer Use boundaries from the original PR #28 prototype and
apply them through the current request tool catalog. Keep conversation
requests and handoffs free of computer tools, and let work select the
inherited, local, sandbox, or disabled runtime without changing authority.

Fixes #129
AI-Generated: true
Generated-At: 2026-09-10T15:38:41Z
Extract plugin routing from the PR 28 prototype through the current
request tool catalog and nested handoffs, with profile controls.

Fixes #130
AI-Generated: true
Generated-At: 2026-09-10T15:30:45Z
Apply server assignments in the shared catalog and handoff predicate,
with a work-only default and explicit profile overrides in the Dashboard.

Fixes #131
AI-Generated: true
Generated-At: 2026-09-10T15:38:42Z
Freeze the selected Skills once for prompts, read_skill, and tool
candidates while keeping workspace Skills in local work requests.

Fixes #132
AI-Generated: true
Generated-At: 2026-09-10T15:45:48Z
Extract the original PR #28 keyword rules for independent comparison. Keep classification disabled by default and explicit work admission independent. Preserve converted Dashboard controls and both translations, with tests for classifier routing and detached requests.

Refs #133

AI-Generated: true
Generated-At: 2026-09-10T16:37:39Z
@xero-team-bot

xero-team-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

⚠️ This PR conflicts with its base branch and needs a rebase.

git fetch origin split/btw-skill-routes
git rebase origin/split/btw-skill-routes
# after resolving the conflicts
git push --force-with-lease

The needs-rebase label is removed automatically once the conflicts are gone.
(Xero-Team/AstrBot · detected by xero-bot)

Base automatically changed from split/btw-skill-routes to master September 10, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(btw): evaluate rule-based task classification

1 participant