Files
molecule-ai-plugin-scheduler/.gitea/workflows/ci.yml
T
hongming 07680a13b8
ci / validate (push) Successful in 15s
meta-ci-advisory / meta (advisory) (pull_request) Successful in 6s
ci / validate (pull_request) Successful in 17s
fix(scheduler): regenerate from sdk 0.6.1 — lease attribution; plugin 0.2.3
Materializes the SDK 0.6.1 trigger-scaffold hotfix. The activity-aware delivery
watchdog shipped in 0.2.2 (sdk 0.6.0) read the runtime's WORKSPACE-GLOBAL turn
lease as though it reported on the delivery in flight. It does not: its
`idle_seconds` measures time since the workspace's last TOOL CALL, so on a
workspace quiet for longer than the 900s idle TTL the lease is ALREADY
idle-expired at the instant a delivery starts. The first 30s probe cancelled the
delivery, the fire re-queued as retryable, durable state never advanced, and the
schedule sat in a permanent 30s cancel/retry loop — observed live on workspace
90139d375511 as 24 `status: timeout` / `cause: idle` entries exactly 30s apart,
all for the same 11:30 slot.

A snapshot is now honoured only when the lease was armed AFTER the delivery
started (`turn_age_seconds < elapsed`). The gate covers the whole snapshot, not
just `idle_expired`, because `absolute_cap_exceeded` is measured from the same
lease's own turn start and is judged first — so gating only idleness would
reproduce the loop under `cause: absolute_cap`. An unattributable lease takes
the `no_liveness_signal` path: wait to the absolute ceiling, never cancel on a
stale verdict.

- scheduler.py: byte-identical to the sdk 0.6.1 trigger scaffold render (drift
  gate re-verified locally against the released wheel's scaffold).
- tests/test_scaffold.py: the scaffold's tests, including the reproduced
  production loop and the one-input `turn_age_seconds` negative-control pair.
- ci.yml: SDK_VERSION 0.6.0 -> 0.6.1 so the drift gate compares against the
  wheel this was generated from.
- plugin.yaml: 0.2.2 -> 0.2.3, carried WITH the change per the repo convention
  (PR #7). #9 omitted it and cost an extra release cycle.
2026-08-05 05:06:03 -07:00

45 lines
2.1 KiB
YAML

name: ci
on: [push, pull_request]
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.11"
# No `cache: pip` — this plugin ships no requirements.txt/pyproject.toml
# (it vendors channel_sdk and installs the authoring SDK ad-hoc below),
# and setup-python's pip cache hard-fails without a deps file to hash.
- name: Install authoring SDK (scaffold SSOT)
# This plugin is a materialized instance of the SDK trigger scaffold, so
# `validate` and the drift gate need the SDK. Install it from its git
# RELEASED-wheel pin: bumped to sdk 0.6.1, which fixes the 0.6.0
# activity-aware watchdog reading the workspace-GLOBAL turn lease as if
# it reported on THIS delivery — on a workspace idle past the 900s TTL
# the lease was already idle-expired when the fire started, so the first
# 30s probe cancelled every delivery and the schedule never advanced. The
# lease is now honoured only when it was armed after the delivery began
# (drift gate byte-identical vs the 0.6.1 wheel). Bump SDK_VERSION (and
# regenerate this plugin) whenever the SDK trigger scaffold changes.
env:
SDK_VERSION: 0.6.1
run: |
# --extra-index-url (not --index-url): the Gitea registry hosts only
# molecule packages; deps (pyyaml) must still resolve from PyPI.
python -m pip install "molecule-ai-sdk==${SDK_VERSION}" \
--extra-index-url https://git.moleculesai.app/api/packages/molecule-ai/pypi/simple/
- name: Manifest validation
run: python -m molecule_plugin validate plugin .
- name: SSOT drift gate (daemon logic == SDK scaffold)
run: python scripts/check_scaffold_drift.py
- name: Daemon unit tests
run: python -m unittest discover -s tests -v