Skip to content

Feature/task redesign - #68

Merged
JSChronicles merged 15 commits into
mainfrom
feature/task_redesign
Aug 12, 2026
Merged

Feature/task redesign#68
JSChronicles merged 15 commits into
mainfrom
feature/task_redesign

Conversation

@JSChronicles

Copy link
Copy Markdown
Owner

Description

Redesign the Anvil task runtime to support dependency-aware, provider-neutral
task execution across multiple scopes.

Changes

  • Add task instance planning and DAG-based scheduling.
  • Support task IDs, declared dependencies, dependency data, and scoped results.
  • Preserve dependency ordering when assembling mixed-scope results.
  • Add provider lifecycle hooks and management-account filtering.
  • Improve task loading, validation, execution context, and failure propagation.
  • Add and update workflow examples, documentation, and task-builder guidance.
  • Expand runner, provider, task contract, scheduler, and planner test coverage.
  • Update the prek, Ruff, and ty development dependencies and refresh uv.lock.

Checklist

  • Python format, lint, and tests (ruff and pytest) were successful.
  • Pre-commit hooks passed locally.
  • Documentation updated if needed.
  • Unit tests added or updated.

Redesign task execution around stable invocation IDs and provider-owned scopes.

- add task IDs, metadata, dependencies, dependency-data selection, and always-run semantics
- plan configured-target, target, and region task instances deterministically
- execute dependency graphs with bounded concurrency and stable result ordering
- support skipped work, partial failure results, cancellation, and activated cleanup
- preserve provider runtime lifecycle, session reuse, and ordinary execution fast paths
- carry task identity through result queries, HTML reports, SARIF reports, and summaries
Migrate built-in tasks to the redesigned keyword-only invocation contract.

- replace provider-specific execution arguments with provider-neutral target identity
- accept separate metadata and dependency_data inputs
- preserve existing task behavior, logging, actions, and dry-run safeguards
- keep task modules compatible with discovery and runtime validation
Add comprehensive coverage for the redesigned task model.

- verify invocation IDs, dependency validation, metadata merging, and result selection
- cover scope expansion, fan-out, fan-in, ordering, concurrency, and cancellation
- protect fail-fast and always-run finalizer activation semantics
- validate provider lifecycle, AWS configured-target identity, and session reuse
- cover skipped and partial results across JSONL, queries, HTML, SARIF, and CLI output
- validate advanced examples and provider-neutral built-in task signatures
- demonstrate repeated components, fan-out, fan-in, partial results, and cleanup
- add a complete configured-target AWS cleanup workflow
- use descriptive IDs in advanced provider examples
- produce SARIF findings without redundant Lambda inventory calls
- refresh returned-result and action-recorder examples
Update the Anvil task-builder skill for redesigned task execution.

- document provider-neutral task signatures and module-declared scopes
- explain invocation IDs, dependencies, dependency data, and partial results
- add configured-target, fan-in, and always-run workflow guidance
- clarify task granularity, provider behavior, and validation expectations
- direct task authors to the complete cleanup workflow example
task_planner.py now indexes producer instances by target and target-region coordinate. Dependency matching is proportional to actual edges while preserving all scope and ordering semantics.

task_scheduler.py now calculates eligibility and groups fan-in results in one traversal.
Added structural performance regressions for both paths.

Benchmark for 20,000 planned instances:
- Before: 6.375s
- After: 0.032–0.034s
- Replaced per-account scans of the entire schedule with one indexing pass.
- Grouped each account’s regional results once rather than rescanning for every region.
- Prevented eager min, max, and timestamp parsing when lifecycle timings already exist.

- 100 accounts (1/2/4 regions): 0.285/0.579/1.200 ms -> 0.030/0.049/0.086 ms
- 1,000 accounts: 26.0/52.6/103.9 ms -> 0.306/0.499/1.068 ms
- 10,000 accounts: 2.58/5.16/10.28 s -> 3.74/5.61/9.71 ms
Ensure regional producer results appear before target-scoped consumers during
mixed-scope fan-in.

- add result-order barrier stages for narrow-to-broad dependencies
- preserve existing target-first and region-major ordering within each stage
- add regression coverage for region-to-target result ordering

not very elegant but is what it is for now
Allow AWS organization targets to use `management` or `payer` in both include and exclude filters.

Resolve these case-insensitive aliases to the discovered management account ID while keeping their semantics owned by the AWS provider.

Reject the keywords in explicit accounts mode, document the behavior, update the AWS include/exclude example, and add validation and execution coverage.
…cy reference

Adds a new reference doc for building or editing Anvil tasks whose workflow targets only the payer/management account, and cross-links it from the existing concurrency guidance.
Add an AWS task that discovers disabled IAM Identity Center users and removes them from the owner account.
Raise the minimum versions of prek, Ruff, and ty, and refresh the uv lockfile.
@JSChronicles
JSChronicles merged commit 50b471f into main Aug 12, 2026
8 checks passed
@JSChronicles
JSChronicles deleted the feature/task_redesign branch August 12, 2026 02:40
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.

1 participant