Skip to content

[flows-tinyflows] flows bug: autonomy tier is frozen at run start #48

Closed

Description

@senamakel

Moved from tinyhumansai#8026, which is closed in favour of this issue. Part of tinyhumansai#8055.

build_capabilities builds one SecurityPolicy per run (flows/tinyflows/caps/ops.rs:634-638); the code, native-tool and Composio gates use it (caps/code.rs:64, caps/tools/native.rs:48, caps/tools/composio.rs:117). The Composio backend reloads config per call because "a capability object can outlive a Settings change", but the tier gate does not. A user who switches Full → ReadOnly mid-run keeps getting Write-class code/native calls without a prompt until the run ends.

Fix: re-derive the policy per gated call (live policy, as security::live_policy does for cron). Regression test: tier change mid-run is honoured by the next call.

Done when: each defect above has a regression test that fails on the unfixed code and passes after the fix. Gates: cargo check (root + crates/openhuman-app), pnpm rust:layout, node scripts/ci/check-feature-forwarding.mjs, pnpm debug rust flows, and the touched crates' tests. RPC namespace strings, model-facing tool names and DomainEvent variant names stay unchanged unless the issue says otherwise.

Agent brief

  • Files to consider (paths under crates/openhuman-core/src/ unless rooted): flows/tinyflows/caps/ops.rs, flows/tinyflows/caps/tier.rs, flows/tinyflows/caps/code.rs, flows/tinyflows/caps/tools/native.rs, flows/tinyflows/caps/tools/composio.rs
  • Research: security::live_policy; how cron/scheduler.rs derives policy.
  • Workflow: an implementing-an-epic step.
  • Subagent: systematic-debugger.
  • Dependencies: none.

Parent: tinyhumansai#8055

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority: p1Next. Wrong behaviour a user will hit, or a security weakness behind a condition.rust-coreCore Rust runtime in src/: CLI, core_server, shared infrastructure.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions