From 40484a8f0b010d31240bf0b60c6351722c8dd2bd Mon Sep 17 00:00:00 2001 From: JerryChaox Date: Tue, 17 Nov 2026 01:48:14 +0800 Subject: [PATCH] fix(agentic-campaign): +apply-spec says apply is accepted and runs in the background Co-Authored-By: Claude --- CHANGELOG.md | 2 +- contracts/command-catalog.json | 4 ++-- docs/agent-discoverability.md | 2 +- docs/domain-command-framework.md | 2 +- museoncli/domains/agentic_campaign.py | 4 +++- skills/museon-content-workflow-ai-slideshow/SKILL.md | 5 +++-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96e532f..2c1158f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Museon CLI follows semantic versioning for its package and command contract. Declarative Agentic Campaign specs. -- New `agentic-campaign +apply-spec --campaign-id --file spec.yaml`: one YAML/JSON file declares Personas and Topics under your own keys, Formats by key -> id, and Plans with their format x topic pairs, an optional exact member roster and an optional dated calendar (`schedule.rule` walks the pairs one per day; `schedule.cells` pins any day, optionally for one account). Without `--preview-token` it previews the diff and returns a token; with the token it applies. Re-applying the same file changes nothing; a changed day re-commits only that Plan. Applying generates nothing by itself. +- New `agentic-campaign +apply-spec --campaign-id --file spec.yaml`: one YAML/JSON file declares Personas and Topics under your own keys, Formats by key -> id, and Plans with their format x topic pairs, an optional exact member roster and an optional dated calendar (`schedule.rule` walks the pairs one per day; `schedule.cells` pins any day, optionally for one account). Without `--preview-token` it previews the diff and returns a token; with the token Museon accepts it (`status: accepted`) and applies it in the background, so preview again until `changed` is false. Re-applying the same file changes nothing; a changed day re-commits only that Plan. Applying generates nothing by itself. - `ai-slideshow publish +create-schedule`, `+preview-schedule-plan`, `+submit-schedule-plan`, the managed-publishing skill and the task guide point multi-day Campaign calendars to `+apply-spec`. ## 2.1.0 diff --git a/contracts/command-catalog.json b/contracts/command-catalog.json index 17527e3..130e02e 100644 --- a/contracts/command-catalog.json +++ b/contracts/command-catalog.json @@ -133,7 +133,7 @@ "risk_level": "write", "shortcut": "+apply-spec", "stability": "stable", - "summary": "Create or overwrite a whole Agentic Campaign from one spec file: Personas and Topics declared inline under your own keys, Formats referenced by key -> id, and Plans with their format x topic pairs, optional member accounts and an optional dated calendar (a sequence rule over the pairs plus explicit cells; a cell may name one account). Run once without --preview-token to see the diff and get a token, show the diff to the user, then run again with --preview-token to apply. Re-applying the same file is a no-op; a changed day re-commits only that Plan. Calendar dates are in the Campaign publish timezone. Applying never generates content by itself; posts are generated for member accounts as their days come up. Prefer this over chaining +plan-create / plan +supply-update / plan +members-reconcile / per-day schedules.", + "summary": "Create or overwrite a whole Agentic Campaign from one spec file: Personas and Topics declared inline under your own keys, Formats referenced by key -> id, and Plans with their format x topic pairs, optional member accounts and an optional dated calendar (a sequence rule over the pairs plus explicit cells; a cell may name one account). Run once without --preview-token to see the diff and get a token, show the diff to the user, then run again with --preview-token to apply: it answers status `accepted` and Museon applies it in the background; run the preview again until it reports changed=false. Re-applying the same file is a no-op; a changed day re-commits only that Plan. Calendar dates are in the Campaign publish timezone. Applying never generates content by itself; posts are generated for member accounts as their days come up. Prefer this over chaining +plan-create / plan +supply-update / plan +members-reconcile / per-day schedules.", "supports_dry_run": true, "transport": "agent_cli_api" }, @@ -18696,7 +18696,7 @@ "risk_level": "write", "shortcut": "+apply-spec", "stability": "stable", - "summary": "Create or overwrite a whole Agentic Campaign from one spec file: Personas and Topics declared inline under your own keys, Formats referenced by key -> id, and Plans with their format x topic pairs, optional member accounts and an optional dated calendar (a sequence rule over the pairs plus explicit cells; a cell may name one account). Run once without --preview-token to see the diff and get a token, show the diff to the user, then run again with --preview-token to apply. Re-applying the same file is a no-op; a changed day re-commits only that Plan. Calendar dates are in the Campaign publish timezone. Applying never generates content by itself; posts are generated for member accounts as their days come up. Prefer this over chaining +plan-create / plan +supply-update / plan +members-reconcile / per-day schedules.", + "summary": "Create or overwrite a whole Agentic Campaign from one spec file: Personas and Topics declared inline under your own keys, Formats referenced by key -> id, and Plans with their format x topic pairs, optional member accounts and an optional dated calendar (a sequence rule over the pairs plus explicit cells; a cell may name one account). Run once without --preview-token to see the diff and get a token, show the diff to the user, then run again with --preview-token to apply: it answers status `accepted` and Museon applies it in the background; run the preview again until it reports changed=false. Re-applying the same file is a no-op; a changed day re-commits only that Plan. Calendar dates are in the Campaign publish timezone. Applying never generates content by itself; posts are generated for member accounts as their days come up. Prefer this over chaining +plan-create / plan +supply-update / plan +members-reconcile / per-day schedules.", "supports_dry_run": true, "transport": "agent_cli_api" }, diff --git a/docs/agent-discoverability.md b/docs/agent-discoverability.md index 81c12d7..f6f2fa5 100644 --- a/docs/agent-discoverability.md +++ b/docs/agent-discoverability.md @@ -397,7 +397,7 @@ after changing specs; `tests/test_docs_sync.py` fails CI on drift. | `agentic-campaign plan +supply-update` | write | yes | — | direct | Set reviewed reference pairs for a Museon persona Plan. This opens a proposal; it does not start publishing. Keep existing pairs when appending. Never creates a Format × Topic cross product. | | `agentic-campaign plan +account-control` | destructive | yes | `--yes` | direct | Control one explicitly selected Museon managed member. Enable after reviewed rollout; pause/resume preserve membership; stop retires and releases it. Already-submitted posts keep reconciling. | | `agentic-campaign plan +extra-post` | write | yes | — | direct | Schedule one more post for one member account of a Plan, outside its daily cadence (for example to make up a missed day). The post uses one of the Plan's current reference pairs (--element-id, or the Plan's rotation when omitted), is generated and published by Museon like the daily posts, and neither replaces nor occupies that day's daily post. The account must be a member with automatic execution enabled, and --scheduled-at (ISO-8601 with offset) at least 30 minutes ahead. Use this instead of `ai-slideshow publish` schedules for Agentic Campaign accounts. | -| `agentic-campaign +apply-spec` | write | yes | — | direct | Create or overwrite a whole Agentic Campaign from one spec file: Personas and Topics declared inline under your own keys, Formats referenced by key -> id, and Plans with their format x topic pairs, optional member accounts and an optional dated calendar (a sequence rule over the pairs plus explicit cells; a cell may name one account). Run once without --preview-token to see the diff and get a token, show the diff to the user, then run again with --preview-token to apply. Re-applying the same file is a no-op; a changed day re-commits only that Plan. Calendar dates are in the Campaign publish timezone. Applying never generates content by itself; posts are generated for member accounts as their days come up. Prefer this over chaining +plan-create / plan +supply-update / plan +members-reconcile / per-day schedules. | +| `agentic-campaign +apply-spec` | write | yes | — | direct | Create or overwrite a whole Agentic Campaign from one spec file: Personas and Topics declared inline under your own keys, Formats referenced by key -> id, and Plans with their format x topic pairs, optional member accounts and an optional dated calendar (a sequence rule over the pairs plus explicit cells; a cell may name one account). Run once without --preview-token to see the diff and get a token, show the diff to the user, then run again with --preview-token to apply: it answers status `accepted` and Museon applies it in the background; run the preview again until it reports changed=false. Re-applying the same file is a no-op; a changed day re-commits only that Plan. Calendar dates are in the Campaign publish timezone. Applying never generates content by itself; posts are generated for member accounts as their days come up. Prefer this over chaining +plan-create / plan +supply-update / plan +members-reconcile / per-day schedules. | | `agentic-campaign plan +posts` | read | — | — | direct | Read this Plan's posts and metrics by account or reference. Missing metrics are not zero results; platform acceptance is not public-post confirmation. | | `agentic-campaign +campaign-review-only` | write | yes | — | direct | Require manual review for future reference/persona/strategy changes in this Museon Campaign, and disable automatic recruitment. Existing confirmed publishing continues. New CLI campaigns use this policy by default. | | `agentic-campaign plan +members-reconcile` | write | yes | — | direct | Atomically reconcile a Plan's managed accounts and matching Plan budget. The CLI reads current versions, raises Campaign total budget only when required, and submits the member/budget change as one compare-and-swap operation. | diff --git a/docs/domain-command-framework.md b/docs/domain-command-framework.md index c788b81..6411373 100644 --- a/docs/domain-command-framework.md +++ b/docs/domain-command-framework.md @@ -431,7 +431,7 @@ The tables below are generated — edit code, then run | `agentic-campaign plan +supply-update` | write | yes | — | direct | Set reviewed reference pairs for a Museon persona Plan. This opens a proposal; it does not start publishing. Keep existing pairs when appending. Never creates a Format × Topic cross product. | | `agentic-campaign plan +account-control` | destructive | yes | `--yes` | direct | Control one explicitly selected Museon managed member. Enable after reviewed rollout; pause/resume preserve membership; stop retires and releases it. Already-submitted posts keep reconciling. | | `agentic-campaign plan +extra-post` | write | yes | — | direct | Schedule one more post for one member account of a Plan, outside its daily cadence (for example to make up a missed day). The post uses one of the Plan's current reference pairs (--element-id, or the Plan's rotation when omitted), is generated and published by Museon like the daily posts, and neither replaces nor occupies that day's daily post. The account must be a member with automatic execution enabled, and --scheduled-at (ISO-8601 with offset) at least 30 minutes ahead. Use this instead of `ai-slideshow publish` schedules for Agentic Campaign accounts. | -| `agentic-campaign +apply-spec` | write | yes | — | direct | Create or overwrite a whole Agentic Campaign from one spec file: Personas and Topics declared inline under your own keys, Formats referenced by key -> id, and Plans with their format x topic pairs, optional member accounts and an optional dated calendar (a sequence rule over the pairs plus explicit cells; a cell may name one account). Run once without --preview-token to see the diff and get a token, show the diff to the user, then run again with --preview-token to apply. Re-applying the same file is a no-op; a changed day re-commits only that Plan. Calendar dates are in the Campaign publish timezone. Applying never generates content by itself; posts are generated for member accounts as their days come up. Prefer this over chaining +plan-create / plan +supply-update / plan +members-reconcile / per-day schedules. | +| `agentic-campaign +apply-spec` | write | yes | — | direct | Create or overwrite a whole Agentic Campaign from one spec file: Personas and Topics declared inline under your own keys, Formats referenced by key -> id, and Plans with their format x topic pairs, optional member accounts and an optional dated calendar (a sequence rule over the pairs plus explicit cells; a cell may name one account). Run once without --preview-token to see the diff and get a token, show the diff to the user, then run again with --preview-token to apply: it answers status `accepted` and Museon applies it in the background; run the preview again until it reports changed=false. Re-applying the same file is a no-op; a changed day re-commits only that Plan. Calendar dates are in the Campaign publish timezone. Applying never generates content by itself; posts are generated for member accounts as their days come up. Prefer this over chaining +plan-create / plan +supply-update / plan +members-reconcile / per-day schedules. | | `agentic-campaign plan +posts` | read | — | — | direct | Read this Plan's posts and metrics by account or reference. Missing metrics are not zero results; platform acceptance is not public-post confirmation. | | `agentic-campaign +campaign-review-only` | write | yes | — | direct | Require manual review for future reference/persona/strategy changes in this Museon Campaign, and disable automatic recruitment. Existing confirmed publishing continues. New CLI campaigns use this policy by default. | | `agentic-campaign plan +members-reconcile` | write | yes | — | direct | Atomically reconcile a Plan's managed accounts and matching Plan budget. The CLI reads current versions, raises Campaign total budget only when required, and submits the member/budget change as one compare-and-swap operation. | diff --git a/museoncli/domains/agentic_campaign.py b/museoncli/domains/agentic_campaign.py index 9a82996..2c36a93 100644 --- a/museoncli/domains/agentic_campaign.py +++ b/museoncli/domains/agentic_campaign.py @@ -1934,7 +1934,9 @@ def _apply_spec_spec() -> CommandSpec: "Plans with their format x topic pairs, optional member accounts and an optional " "dated calendar (a sequence rule over the pairs plus explicit cells; a cell may " "name one account). Run once without --preview-token to see the diff and get a " - "token, show the diff to the user, then run again with --preview-token to apply. " + "token, show the diff to the user, then run again with --preview-token to apply: " + "it answers status `accepted` and Museon applies it in the background; run the " + "preview again until it reports changed=false. " "Re-applying the same file is a no-op; a changed day re-commits only that Plan. " "Calendar dates are in the Campaign publish timezone. Applying never generates " "content by itself; posts are generated for member accounts as their days come up. " diff --git a/skills/museon-content-workflow-ai-slideshow/SKILL.md b/skills/museon-content-workflow-ai-slideshow/SKILL.md index e21ddf1..001530e 100644 --- a/skills/museon-content-workflow-ai-slideshow/SKILL.md +++ b/skills/museon-content-workflow-ai-slideshow/SKILL.md @@ -96,8 +96,9 @@ plans: 1. `museoncli agentic-campaign +apply-spec --campaign-id --file spec.yaml` previews: it writes nothing and returns the diff and a `preview_token`. 2. Show the diff to the user. On their go-ahead run the same command with - `--preview-token `. A changed campaign after the preview is refused; - preview again. + `--preview-token `; it answers `status: accepted` and applies in the + background. Preview again until it reports `changed: false`. A changed + campaign after the preview is refused; preview again. 3. Re-applying the same file is a no-op; editing one day re-commits only that Plan. Calendar dates are in the Campaign publish timezone. Days without a cell keep the Plan's rotation. Plans without accounts keep their calendar