Skip to content

refactor(contract)!: remove command policy from TinyBox - #100

Draft
senamakel wants to merge 11 commits into
mainfrom
tinybox-p5-v2
Draft

senamakel wants to merge 11 commits into
mainfrom
tinybox-p5-v2

Conversation

@senamakel

@senamakel senamakel commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Contract 2.0 removes TinyBox-owned command classification and execution-policy results. The module no longer exposes AnalyzeCommand, command classes/segments, executor and environment-guard signals, or AnalyzeShell.hidden_execution. AnalyzeShell retains only structural segments and output-redirection facts; generic shell transport and scanning remain. TinySecurity owns command policy.

This is a dependent breaking-contract draft. Contract 1.22 was published in v0.1.39 and remains in v0.1.40. Do not merge or release this breaking-contract PR until the OpenHuman major-2 host adapter is prepared. Old 1.x hosts must reject a 2.x module by the advertised major; no compatibility fallback is provided.

Validation passed:

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --all-targets --all-features
  • cargo test --all-features
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
  • scripts/check-coverage.sh (all 88 source files at or above 90%)

The 1.22 native-resource changes remain in the previous contract and are not removed by this branch.

Pre-1.0 package version

Because contract 2.0 removes the policy API, every workspace package is now versioned 0.2.0, following the required minor bump for a breaking change before 1.0. Internal path-dependency constraints and the matching Cargo.lock package entries are updated. The PR remains a dependent draft until contract 1.22 is published and the OpenHuman major-2 adapter is ready. This metadata follow-up passes offline workspace metadata resolution, all-target/all-feature check, formatting, and strict Clippy.

Current main integration

Normal merge 80db00dda9a58eb4cca5a8e63af90b40e2df5d75 preserves the v0.1.40 Bubblewrap jail backend and all current main history while retaining the 0.2.0 package version and contract 2.0 policy API removal. The deprecated hidden_execution field and command-classification types remain removed.

Fresh validation on that merge: formatting, locked workspace/all-target/all-feature check, workspace/all-feature tests, and strict workspace/all-target/all-feature Clippy pass. The test command reports 1,281 passes, zero failures, and five existing fixture-dependent ignored tests; hosted module E2E and coverage checks still need to pass on this head. The PR remains a dependent draft for the host adapter.

Add a test asserting that contract version 2.0 drops the AnalyzeCommand
method while retaining AnalyzeShell, so the wire contract change is
guarded against regressions.

Auto-committed-on: dragonfly
…e/src/shell/analysis.rs,crates/

Auto-committed-on: dragonfly
This change updates several contract versions across tests and removes deprecated command analysis methods from the module interface. The shell analysis now relies solely on structural scanning, removing reliance on the old classification logic.

Auto-committed-on: dragonfly
The compiled module no longer returns CommandAnalysis and CommandClass
values, since command policy is owned by TinySecurity rather than the
bus. The verify_module example now checks generic shell structure only.

Auto-committed-on: dragonfly
Contract 2.0 removes the policy results that 1.22 deprecated for one release,
including AnalyzeCommand, CommandClass, classification fields, guard signals,
and AnalyzeShell.hidden_execution. AnalyzeShell now reports only generic shell
structure, and TinySecurity owns command classification and execution policy.
Old 1.x hosts must reject a 2.x module since no fallback reconstructs policy.

Auto-committed-on: dragonfly
This update reflects the removal of command classification and execution policy methods as part of the transition to contract 2.0. Several documentation files and source code components have been updated to reflect this breaking change, ensuring that TinyBox no longer degrades silently when policy enforcement is unavailable.

Auto-committed-on: dragonfly
Reformatted the proxy call in the unknown method rejection test to split the chained call across multiple lines. This is a formatting-only change with no behavioural difference.

Auto-committed-on: dragonfly
…ybox-module/src/tinybus_module/

Auto-committed-on: dragonfly
@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Raise the workspace package version from 0.1.38 to 0.2.0 and align the
internal path dependency requirements, which had drifted to 0.1.25 and
0.1.32, with the new release. Cargo.lock is regenerated to match.

Auto-committed-on: dragonfly
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