建立 Watchman 规划基线,并接入 Marionettist Cursor 工作流。
公司规范只约束代码内容,门禁仍按插件执行;MCP token 不入库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
8b2a809f06
73 files changed
+8661
No files matched your search
@@ -0,0 +1,188 @@
|
||||
# Knowledge Map
|
||||
|
||||
This file routes agents and humans to project knowledge.
|
||||
|
||||
It must not become a code index. Do not list every file, class, function, or symbol here.
|
||||
|
||||
Docs explain context. Rules enforce constraints. Keep them separate and update this file whenever docs or rules are added, moved, renamed, or deleted.
|
||||
|
||||
Rule files may also record rule metadata such as `type`, `confidence`, and `source`. Read those semantics from `AGENTS.md` and the rule files themselves; do not treat every rule entry as equally strong by default.
|
||||
|
||||
When `marionettist.config.yaml` exists, read `knowledge.mode` and `knowledge.maturity` before deciding how much knowledge to load or create.
|
||||
|
||||
## Project Overview
|
||||
|
||||
- Knowledge Docs:
|
||||
- `docs/project/` for repository-wide workflow and routing
|
||||
- `docs/project/tier-policy-workflow-design.md` for installed future-facing Tier-policy workflow research boundaries and roadmap context
|
||||
- `docs/current/` for current-state knowledge about how the project works today
|
||||
- `docs/target/` for desired future design, migration direction, or proposed architecture
|
||||
- Rule Files:
|
||||
- `AGENTS.md`
|
||||
- `.aiassistant/rules/*.md`
|
||||
- Scope:
|
||||
- route readers to the smallest relevant set of docs and rules
|
||||
- keep current fact separate from target intent
|
||||
- When To Read:
|
||||
- before loading detailed docs for a non-trivial task
|
||||
- whenever docs, rules, or file roles change
|
||||
- Boundary Notes:
|
||||
- `docs/current/` is for observed reality first
|
||||
- `docs/target/` is for future intent, not current fact
|
||||
- label knowledge as fact, inference, or unknown inside detailed docs
|
||||
- keep rule-strength metadata in rule files, not in knowledge docs
|
||||
|
||||
## Current-State-First Routing
|
||||
|
||||
For mixed-responsibility, legacy-heavy, or mudball projects, start with `docs/current/` unless the task is explicitly about future design.
|
||||
|
||||
Use this order:
|
||||
|
||||
1. read `AGENTS.md` and relevant rules first
|
||||
2. read `docs/project/knowledge-map.md` to choose the smallest relevant knowledge area
|
||||
3. read `docs/current/...` for how the project works today
|
||||
4. read `docs/target/...` only when the task involves planned changes, migration direction, or intentional future-state design
|
||||
|
||||
If the current state is unclear, document the uncertainty as an unknown instead of filling the gap with target design.
|
||||
|
||||
## Project Workflow Design
|
||||
|
||||
- Areas: Marionettist task flow, Tier-based routing, gate boundaries, future workflow configurability
|
||||
- Tags: workflow, tier, gate-policy, task-state, research
|
||||
- Docs:
|
||||
- Current: `docs/project/marionettist-workflow.md`
|
||||
- Target: `docs/project/tier-policy-workflow-design.md`
|
||||
- Rules:
|
||||
- `AGENTS.md`
|
||||
- Read When:
|
||||
- working on Marionettist execution flow, Tier policy, gate behavior, or future workflow design boundaries
|
||||
- Boundaries:
|
||||
- keep `gatePolicy` semantics unchanged
|
||||
- treat Tier policy as classification/workflow-hint logic until a later approved design says otherwise
|
||||
- do not treat the design draft as implemented behavior
|
||||
- use the design draft to understand deferred hardening and future-engine boundaries, not current execution rules
|
||||
- Validation:
|
||||
- confirm project-neutral language
|
||||
- confirm proposed workflow configurability remains design-only unless explicitly implemented in an approved slice
|
||||
|
||||
## Knowledge Maturity Routing
|
||||
|
||||
Use `knowledge.maturity` to scale routing depth and governance expectations:
|
||||
|
||||
- **L0**: route only the minimum docs and rules needed for the task; prefer explicit unknowns over broad discovery
|
||||
- **L1**: prioritize `docs/current/` coverage for entrypoints, major flows, risk zones, and safe-change advice
|
||||
- **L2**: maintain reusable routing for important areas and load both current and target docs only when they materially affect the task
|
||||
- **L3**: expect stronger routing discipline, clearer ownership notes, and docs/rules sync when meaning changes
|
||||
- **L4**: expect high-trust curated routing, stronger confirmed/hard rule usage, and careful separation of current fact vs target intent
|
||||
|
||||
Use maturity as a scaling guide, not as a reason to load all docs.
|
||||
|
||||
For `knowledge.mode: mudball`:
|
||||
|
||||
- default to `docs/current/` first at every maturity level
|
||||
- keep target docs optional and future-facing
|
||||
- treat L0-L1 as valid operating levels
|
||||
- do not assume L3/L4 governance unless the project explicitly chose it
|
||||
|
||||
## Knowledge Labels
|
||||
|
||||
Detailed docs should distinguish:
|
||||
|
||||
- **Fact**: directly observed in code, config, runtime behavior, logs, or confirmed repository docs
|
||||
- **Inference**: likely interpretation of current behavior that still needs confirmation
|
||||
- **Unknown**: unresolved question, missing evidence, or area not yet inspected
|
||||
- **Target**: desired future behavior or design direction; keep this in `docs/target/` unless a current-state doc must reference it for contrast
|
||||
|
||||
Do not silently upgrade inference or target guidance into present-day fact.
|
||||
Do not silently upgrade `observed` or `target` rules into enforceable hard constraints.
|
||||
|
||||
## How To Use This File
|
||||
|
||||
- Use this file to choose a small set of relevant docs and rules.
|
||||
- Match the task to one or more knowledge areas by purpose, workflow, ownership, validation needs, or change surface.
|
||||
- Read only the entries that match the current task.
|
||||
- Prefer `docs/current/` for real behavior and `docs/target/` for intended future behavior.
|
||||
- Prefer rule files for constraints, and check rule metadata before treating a rule as a blocker.
|
||||
- Use repository search or source inspection for file and symbol lookup.
|
||||
- Do not list the whole repository here.
|
||||
|
||||
## Knowledge Area Template
|
||||
|
||||
Copy this block for each major project area:
|
||||
|
||||
```md
|
||||
### <Area Name>
|
||||
|
||||
- Areas:
|
||||
- Tags:
|
||||
- Docs:
|
||||
- Current: `docs/current/...`
|
||||
- Target: `docs/target/...`
|
||||
- Rules:
|
||||
- `.aiassistant/rules/...`
|
||||
- `AGENTS.md`
|
||||
- Read When:
|
||||
- Boundaries:
|
||||
- Validation:
|
||||
```
|
||||
|
||||
## Watchman
|
||||
|
||||
业务文档仍以仓库原有文档为准。本文件只做路由,不复制需求正文。
|
||||
|
||||
### 产品范围与进度
|
||||
|
||||
- Areas: 预警平台规划、模块任务、当前进度
|
||||
- Tags: watchman, planning, progress, tasks
|
||||
- Docs:
|
||||
- Current: `docs/progress.md`、`docs/decisions.md`、`docs/current/system-map.md`
|
||||
- Target: `docs/development-plan.md`、`需求冻结文档_V1.1_交接稿.md`、`docs/target/architecture-intent.md`
|
||||
- Rules:
|
||||
- `AGENTS.md` 项目本地段
|
||||
- Read When:
|
||||
- 判断现在做到哪、哪个模块可以做、哪些决策还没确认
|
||||
- Boundaries:
|
||||
- 规划文档存在不等于可以开始业务编码
|
||||
- `docs/tasks/INDEX.md` 是模块计划;`.task/` 不替换它
|
||||
- Validation:
|
||||
- 以 `docs/testing-plan.md` 和当前任务卡里的证据为准
|
||||
|
||||
### 公司规范与 Marionettist
|
||||
|
||||
- Areas: 编码约束、门禁、Cursor 规则
|
||||
- Tags: sy-standards, gate, cursor
|
||||
- Docs:
|
||||
- Current: `docs/agent-workflow.md`
|
||||
- Target: `docs/project/marionettist-workflow.md`
|
||||
- Rules:
|
||||
- `.cursor/rules/workflow-rules.mdc`
|
||||
- `.cursor/rules/sy-standards.mdc`
|
||||
- `.cursor/rules/00-repository-rules.mdc`
|
||||
- Read When:
|
||||
- 准备写代码,或需要判断该停下来还是该查公司规范
|
||||
- Boundaries:
|
||||
- 门禁听 Marionettist
|
||||
- API、前端、注释、提交、密钥听 sy-standards
|
||||
- 不把 MCP token 写入仓库
|
||||
- Validation:
|
||||
- 改动平台代码前能指出对应的 `standards://` 篇目和版本
|
||||
|
||||
## Mudball-Friendly Documentation Guidance
|
||||
|
||||
For codebases with unclear boundaries or mixed responsibilities:
|
||||
|
||||
- document current entrypoints, call paths, risk zones, and safe-change advice before proposing cleanup
|
||||
- keep related-file notes small and purpose-based, not exhaustive
|
||||
- prefer facts and unknowns over polished architecture language
|
||||
- prefer gradual maturity growth over immediate governance escalation
|
||||
- add target-state docs only when they help explain a proposed improvement or migration path
|
||||
|
||||
## Path-Proximity Rule Reminder
|
||||
|
||||
When target files are known, agents should also look upward from those paths for local rule files such as:
|
||||
|
||||
- `MODULE_RULES.md`
|
||||
- `AGENTS.md`
|
||||
- `HARNESS_RULES.md`
|
||||
|
||||
Local path rules narrow area-specific behavior, but repository-global safety and boundary rules still take precedence if there is a conflict.
|
||||
@@ -0,0 +1,588 @@
|
||||
# Marionettist Workflow
|
||||
|
||||
This project uses a lightweight file-based Marionettist workflow so requirements, knowledge routing, implementation slices, and execution context stay visible in normal repository files. The goal is to keep repository-agent work reproducible without adding a separate workflow system.
|
||||
|
||||
When `marionettist.config.yaml` exists, read `knowledge.mode` and `knowledge.maturity` before deciding how much documentation, governance, and validation ceremony to apply.
|
||||
|
||||
## Standard Task Flow
|
||||
|
||||
This project uses a branched Marionettist workflow based on task complexity:
|
||||
|
||||
1. **Tier S (Minor)**: Clearly scoped localized low-risk work. Skip `.task/` documents and gates. Direct coding and review.
|
||||
2. **Tier M (Standard)**: Analysis plus task-scoped `.task/<task-id>/context-pack.md` before coding. `requirement-freezer` is optional and only used when behavior or business rules are unclear.
|
||||
3. **Tier L (Complex)**: Large, cross-boundary, compatibility/security/production-sensitive, or genuinely ambiguous work. Full mandatory Marionettist flow with analysis, approved slice execution, automatic slice review, and finalization.
|
||||
|
||||
For Tier M and L, the agent must complete phases in order. They must not automatically cross the analysis gate, and they must not automatically cross an inter-slice gate unless the selected gate policy explicitly permits that continuation and no mandatory stop applies.
|
||||
|
||||
Critic defaults by tier are:
|
||||
- **Tier S**: no critic by default
|
||||
- **Tier M**: critic optional, but recommended for risky or boundary-sensitive work
|
||||
- **Tier L**: critic required before coding and before declaring approved work done
|
||||
|
||||
Treat a task as high-risk when it includes sensitive refactors, workflow-sensitive changes, boundary ambiguity, unusual validation uncertainty, or explicit high-risk wording in the task artifacts.
|
||||
|
||||
In this file, `<task-id>` means the active `taskId` value from `.task/active.json`.
|
||||
|
||||
`.task/active.json` is a local singleton pointer for one repository root or checked-out worktree. It is safe as a per-root or per-worktree selector, but it must not be treated as implicit cross-worktree delegation context.
|
||||
|
||||
## Gate Policy Defaults
|
||||
|
||||
When `marionettist.config.yaml` defines `gatePolicy`, it sets the repository default gate posture for non-trivial work:
|
||||
|
||||
```yaml
|
||||
gatePolicy:
|
||||
defaultMode: "balanced" # strict | balanced | autonomous
|
||||
finalApprovalRequired: true
|
||||
allowTaskOverride: true
|
||||
```
|
||||
|
||||
Mode semantics:
|
||||
|
||||
- `strict`: stop at the analysis-to-coding gate and after every approved coding slice or approved parallel group.
|
||||
- `balanced`: preserve the analysis gate and final approval by default; allow continuation for already-approved `simple` slices and low/moderate-risk `standard` slices with `risk_score <= 3`, and only when the approved plan and selected policy explicitly permit that continuation and no mandatory stop applies.
|
||||
- `autonomous`: preserve the analysis gate and final approval by default; allow continuation only for already-approved next slices or approved parallel groups whose frozen `gateClass` is `simple` or `standard`, whose supplemental `risk_score` is `3` or lower, and for which no mandatory stop applies; still stop mid-task for `gateClass: high-risk`, `gateClass: boundary-sensitive`, critic-required, explicit gates or stop conditions, protected-area or dangerous-command work, or any slice whose supplemental `risk_score` requires a stronger pause than `gateClass` alone.
|
||||
|
||||
`allowTaskOverride: true` means task-local artifacts may choose a different gate mode than `defaultMode` for that task. It does not let task-local artifacts bypass higher-priority user instructions, required analysis gates, required final approval, or any other explicit stop condition in this workflow.
|
||||
|
||||
Selecting a task-local override is a policy choice for that task, not a bypass of required gates. A task may become more or less interruption-tolerant within the allowed workflow, but it must still stop wherever this workflow or the user explicitly requires a stop.
|
||||
|
||||
Policy precedence for the current task is:
|
||||
|
||||
1. explicit user instruction and task-local `gatePolicy.selected`
|
||||
2. `marionettist.config.yaml` `gatePolicy.defaultMode` as fallback when no task-local selection exists
|
||||
3. `recommended` values from tier hints or task artifacts as advisory context only
|
||||
|
||||
In other words, `defaultMode` sets repository default posture, not an override of a selected task policy. A `recommended` value may explain why `strict` is safer for a task, but it must not replace an explicit task-local `selected` mode.
|
||||
|
||||
Template default is `balanced` for general target-project usability. Tier L or otherwise high-risk tasks may recommend `strict`, but an explicit task-local `gatePolicy.selected` value remains controlling for continuation posture and must not be overwritten by the recommendation.
|
||||
|
||||
`gatePolicy` does not replace normal stop conditions. Human confirmation is still required for protected-area changes, requirement ambiguity, compatibility tradeoffs, or any other explicitly blocked decision.
|
||||
|
||||
## Gate Class Vocabulary
|
||||
|
||||
For this workflow, `gateClass` is a non-replaced hint vocabulary frozen to:
|
||||
|
||||
- `simple`
|
||||
- `standard`
|
||||
- `boundary-sensitive`
|
||||
- `high-risk`
|
||||
|
||||
`risk_score` is supplemental per-slice gate metadata with an integer range from `1` to `5`:
|
||||
|
||||
- `1`: very low additional risk signal
|
||||
- `2`: low additional risk signal
|
||||
- `3`: moderate additional risk signal; common for bounded `standard` slices
|
||||
- `4`: elevated additional risk signal; use only when concrete risk or uncertainty requires a stronger pause
|
||||
- `5`: highest additional risk signal
|
||||
|
||||
`risk_score` does not replace `gateClass`, invent new gate classes, or weaken any pause that `gateClass`, critic requirements, or explicit gate reasons already require.
|
||||
|
||||
Use `risk_score` only to preserve or strengthen the safer pause behavior relative to `gateClass`. Do not inflate `risk_score` merely because work is non-trivial; ordinary bounded `standard` slices should usually remain at 2-3 unless concrete elevated impact, reversibility concern, or validation uncertainty exists. If the numeric score indicates higher risk than `gateClass` alone, agents must keep the stricter stop.
|
||||
|
||||
Treat these as common higher-risk inputs when assigning or explaining `risk_score`:
|
||||
|
||||
- database schema updates
|
||||
- permissions or security logic
|
||||
- device communication
|
||||
- scheduling
|
||||
- externally committed public API compatibility
|
||||
- build or release scripts
|
||||
- code deletion
|
||||
- dependency upgrades
|
||||
- production configuration
|
||||
|
||||
In `balanced` mode, continuation remains limited to already-approved `simple` slices and low/moderate-risk `standard` slices with `risk_score <= 3`, and only when no explicit gate reason or task instruction requires a pause.
|
||||
|
||||
In selected `autonomous` mode, continuation to the next already-approved slice or approved parallel group is allowed without extra slice confirmation only when all of the following are true:
|
||||
|
||||
- the next approved work has frozen `gateClass: simple` or `gateClass: standard`
|
||||
- the next approved work has `risk_score <= 3`
|
||||
- the next approved work is not critic-required
|
||||
- no explicit gate reason or stop condition requires a pause
|
||||
- no protected-area decision or dangerous command requires a pause
|
||||
|
||||
Selected `autonomous` never weakens mandatory stops. The workflow must still pause for the analysis-to-coding gate, final approval when required, `gateClass: boundary-sensitive`, `gateClass: high-risk`, critic-required work, explicit gates or stop conditions, protected-area or dangerous-command decisions, and any approved work with `risk_score >= 4`.
|
||||
|
||||
## Tier Policy And Future Workflow Configuration
|
||||
|
||||
Tier policy is intended to guide task classification and workflow hints. It must not replace this workflow definition, change mandatory gate behavior, or redefine `gatePolicy` semantics.
|
||||
|
||||
If the project later adopts configurable Tier policy, treat the executable flow in this document as the MVP source of truth unless a future approved design explicitly introduces a broader workflow engine. For the deferred-design boundary of that future work, see `docs/project/tier-policy-workflow-design.md`.
|
||||
|
||||
When `.marionettist/tier-policy.yml` exists, use it as the project-local source for Tier descriptions, match-rule text, workflow hints, review hints, and model-profile hints during task intake.
|
||||
|
||||
The installed `.marionettist/tier-policy.yml` file is a safe managed starting point:
|
||||
|
||||
- `marionettist init` may install it as framework-managed project scaffolding
|
||||
- `marionettist diff` and `marionettist sync` must preserve project-local edits instead of silently overwriting them
|
||||
- task intake should explain whether it is using the project-local file, framework defaults, or a safe fallback after parse/validation problems
|
||||
|
||||
Precedence for the MVP is:
|
||||
|
||||
1. this workflow document and `gatePolicy` remain the source of executable gate behavior
|
||||
2. built-in framework Tier defaults apply when `.marionettist/tier-policy.yml` is missing
|
||||
3. project-local `.marionettist/tier-policy.yml` may refine Tier classification and hint text within the fixed Tier `S` / `M` / `L` vocabulary
|
||||
4. refinements may be auto-accepted with explanation, explicit overrides should be marked clearly, and unsafe downgrades must fall back to safer framework defaults instead of silently relaxing them
|
||||
|
||||
In `.marionettist/tier-policy.yml`, `tiers.<tier>.gateHint` is advisory only. It may suggest labels such as `default` or `prefer-strict`, but it does not replace `gatePolicy.defaultMode`, does not change the selected task-local gate mode, and does not bypass any required stop in this workflow.
|
||||
|
||||
In `.marionettist/tier-policy.yml`, `tiers.<tier>.modelProfileHint` must reference an existing profile role or name from `.marionettist/model-profiles.yml`. It must not embed provider IDs or model IDs directly.
|
||||
|
||||
For the current MVP, this is a documented authoring constraint and advisory hint. Automatic cross-validation of `modelProfileHint` against `.marionettist/model-profiles.yml` is deferred future hardening, so agents should explain uncertainty instead of inventing or silently accepting raw provider/model IDs.
|
||||
|
||||
Current schema boundary for `.marionettist/tier-policy.yml`:
|
||||
|
||||
- root keys: `schemaVersion`, `tiers`
|
||||
- required tier entries: `S`, `M`, `L`
|
||||
- required fields inside each tier: `description`, `matchRules`, `workflowHint`, `gateHint`, `reviewLevel`, `modelProfileHint`
|
||||
- optional fields inside each tier: `minTier`, `maxTier`
|
||||
- allowed scalar values for `minTier` and `maxTier`: `S`, `M`, `L`, or `null`
|
||||
- `matchRules` is a list of plain strings only
|
||||
|
||||
Do not use anchors, merge keys, inline objects, or multi-document YAML in this file for the current MVP.
|
||||
|
||||
Unknown or unsupported ordered-field values should be treated conservatively and explained clearly. Stricter automatic rejection behavior for those cases is deferred future hardening rather than part of the current MVP contract.
|
||||
|
||||
### Implemented MVP Vs Deferred Hardening
|
||||
|
||||
Implemented now:
|
||||
|
||||
- managed install path at `.marionettist/tier-policy.yml`
|
||||
- framework defaults when the project-local file is missing
|
||||
- parse/validation feedback with safe fallback where needed
|
||||
- advisory hints for `workflowHint`, `gateHint`, `reviewLevel`, and `modelProfileHint`
|
||||
- conflict handling that distinguishes refinement, explicit override, soft conflict, and unsafe downgrade
|
||||
- natural-language candidate authoring with diff-before-write and explicit confirmation before persistence
|
||||
|
||||
Deferred future hardening:
|
||||
|
||||
- automatic cross-validation that every `modelProfileHint` resolves in `.marionettist/model-profiles.yml`
|
||||
- stricter handling for unknown ordered-field values beyond the current conservative explanation/fallback posture
|
||||
- any configurable workflow-DAG or broader workflow-engine behavior
|
||||
|
||||
### Natural-Language Tier Policy Editing
|
||||
|
||||
Projects may ask the builder/config workflow to update `.marionettist/tier-policy.yml` from natural-language instructions.
|
||||
|
||||
For this MVP, the safe authoring flow is:
|
||||
|
||||
1. interpret the user's prose as a candidate Tier-policy change
|
||||
2. draft candidate YAML in the current schema only
|
||||
3. compare the candidate against the current `.marionettist/tier-policy.yml`, or against framework defaults when the file does not exist yet
|
||||
4. show the candidate YAML and a diff before any write
|
||||
5. surface any already-available Tier-policy explanation, refinement, override, or conflict notes
|
||||
6. require explicit user confirmation before persisting the candidate
|
||||
|
||||
The agent must not silently write Tier-policy changes from prose alone. If the user requests revisions, update the candidate and show the revised diff again before persistence.
|
||||
|
||||
### Analysis Phase
|
||||
|
||||
The agent may perform any of the following as needed:
|
||||
- use `task-intake` to classify the task and identify the next Marionettist step
|
||||
- use `requirement-freezer` when business rules, expected behavior, compatibility, or scope need stabilization
|
||||
- use `workflow-inspector` when execution flow or workflow impact is important
|
||||
- use `module-inspector` when module ownership, modifiability, or dependency direction is unclear
|
||||
- use `implementation-slicer` to convert requirements or goals into slices
|
||||
- use `context-pack-builder` to create `.task/<task-id>/context-pack.md` before coding
|
||||
|
||||
**Bugfix Fast-Track**: For bug fixes, the analysis phase is considered complete once a failing test case or clear reproduction steps are confirmed. Formal requirement freezing is usually bypassed unless expected behavior is unclear.
|
||||
|
||||
The analysis phase may produce:
|
||||
- `.task/active.json`
|
||||
- `.task/<task-id>/requirement.md`
|
||||
- `.task/<task-id>/implementation-plan.md`
|
||||
- `.task/<task-id>/context-pack.md`
|
||||
- `.task/<task-id>/state.json`
|
||||
|
||||
When building `.task/<task-id>/context-pack.md`, route context in this order:
|
||||
1. load global rules and task artifacts first
|
||||
2. use `docs/project/knowledge-map.md` to match only the relevant knowledge areas
|
||||
3. prefer `docs/current/...` for actual present-day behavior and use `docs/target/...` only when future design matters to the task
|
||||
4. if target files are known, walk upward from those paths to load nearby `MODULE_RULES.md`, `AGENTS.md`, and `HARNESS_RULES.md`
|
||||
5. exclude unrelated docs and note the exclusion briefly
|
||||
|
||||
For incident or bugfix work, include `.task/<task-id>/incident.md` when it exists and is relevant.
|
||||
|
||||
### Knowledge Mode And Maturity
|
||||
|
||||
Use `marionettist.config.yaml` as the local default when it defines:
|
||||
|
||||
- `knowledge.mode`: `standard` or `mudball`
|
||||
- `knowledge.maturity`: `L0`, `L1`, `L2`, `L3`, or `L4`
|
||||
|
||||
Knowledge mode sets the starting posture:
|
||||
|
||||
- `standard`: balance current-state understanding with design intent
|
||||
- `mudball`: start from present-day behavior, risk, and safe-change advice; do not assume clean boundaries
|
||||
|
||||
Knowledge maturity scales how much documentation depth and governance the agent should expect:
|
||||
|
||||
- **L0 — Minimal capture**: task-local context, sparse docs, explicit unknowns, low ceremony
|
||||
- **L1 — Current-state map**: capture entrypoints, major flows, risk zones, unknowns, and safe-change notes first
|
||||
- **L2 — Reusable area knowledge**: maintain stable routing, important current/target docs, and reviewed rule metadata for important areas
|
||||
- **L3 — Governed knowledge**: stronger docs/rules sync, clearer ownership, and regular drift checks between current and target knowledge
|
||||
- **L4 — Strict governance**: curated high-trust knowledge, explicit hard/confirmed constraints, and strong validation/review expectations for boundary-sensitive change
|
||||
|
||||
Scaling guidance:
|
||||
|
||||
- At **L0-L1**, do not require broad documentation before small safe changes.
|
||||
- At **L2**, expect meaningful docs updates when design understanding changes.
|
||||
- At **L3-L4**, expect stronger docs/rules synchronization and clearer validation evidence for architecture or boundary changes.
|
||||
- In `mudball` mode, default to current-state-first behavior even when maturity is higher, and do not pressure the project toward L3/L4 unless users explicitly choose that posture.
|
||||
|
||||
When analysis is complete, the agent must stop and wait for explicit user confirmation before starting coding, except Tier S.
|
||||
|
||||
### Critic Gates
|
||||
|
||||
The critic gate is a risk-control checkpoint, not a coding authorization.
|
||||
|
||||
1. **Plan-review critic gate**
|
||||
- Runs after the relevant requirement, implementation plan, and context pack exist.
|
||||
- Required for Tier L and high-risk work before coding starts.
|
||||
- Optional for Tier M when the work is straightforward and low-risk.
|
||||
- A critic `PASS` may satisfy `criticPassed`, but it does not bypass `allowedToCode`, the current phase, or human confirmation.
|
||||
|
||||
2. **Pre-done critic gate**
|
||||
- Runs after coding and review for Tier L or high-risk approved work.
|
||||
- Checks gate evidence before the agent declares the approved work done: reviewer verdict, validation result, unresolved blockers, changed-file inventory, forbidden-file status, and state/gate consistency.
|
||||
- Does not replace `marionettist-reviewer`, validation, or the normal slice gate.
|
||||
- Must not repeat full code review or broad repository discovery. If evidence is missing, report the missing evidence instead of rediscovering the repository.
|
||||
|
||||
### Coding Phase
|
||||
|
||||
The agent must code only from the approved context pack and approved implementation slice or approved parallel slice group.
|
||||
|
||||
For complex tasks, the approved implementation plan may define `parallel-capable` slices or approved parallel slice groups. This is optional planning metadata, not a requirement that every agent must run in parallel.
|
||||
|
||||
The agent may complete temporary substeps inside the current approved slice or group without asking again, for example:
|
||||
- editing multiple files inside the same approved slice
|
||||
- local refactoring required only for that slice
|
||||
- running validation commands for that slice
|
||||
- fixing slice-local test failures
|
||||
|
||||
When a confirmed parallel slice group is active:
|
||||
- agents with subagent or safe parallel execution support may execute the group members concurrently
|
||||
- agents without that capability must execute the same group members sequentially in the declared fallback order
|
||||
- the primary agent remains responsible for merging results, resolving conflicts, and running group validation
|
||||
|
||||
When the current coding slice is complete, the agent must automatically perform review for that same slice before stopping at the slice gate.
|
||||
|
||||
For Tier L or high-risk work, the agent should also run the pre-done critic gate after coding and review, then include the result in the slice or final summary.
|
||||
|
||||
When the current approved work is a parallel slice group, the agent must stop only after the whole approved group is complete, merged, validated, and reviewed, then wait for explicit user confirmation before the next slice or group unless the selected gate policy explicitly allows continuation for the next already-approved slice or group and no mandatory stop applies.
|
||||
|
||||
If review fails for the current slice or group, the agent may plan the smallest slice-local fix, apply it, and re-run review. Stop for user decision if the same slice or group is still blocked after 3 total review attempts.
|
||||
|
||||
When all approved coding slices and groups are complete, the agent must stop with a final validation and review summary.
|
||||
|
||||
Even in selected `autonomous`, completing one slice never authorizes unapproved future work. Continuation applies only to the next already-approved slice or approved parallel group that remains eligible under the mandatory-stop rules above.
|
||||
|
||||
Validation levels are:
|
||||
- slice validation: checks the current slice only
|
||||
- group validation: checks all members of the approved parallel group after merge or sequential fallback execution
|
||||
- final validation: checks the full approved implementation after slice review is complete
|
||||
- review validation: records boundary-reviewer findings and any remaining validation gaps
|
||||
|
||||
### Review Phase
|
||||
|
||||
Review for the current approved slice or group starts automatically after implementation. A separate user confirmation is not required between coding and review for the same approved slice or group.
|
||||
|
||||
Review includes:
|
||||
- boundary review
|
||||
- scope check against allowed and forbidden modifications
|
||||
- rule conflict check
|
||||
- validation status check
|
||||
- docs, rules, and knowledge-map sync decision
|
||||
|
||||
Review is diff-first and bounded to the current approved slice or group. The reviewer starts from the changed-file inventory and reads only changed files plus directly required context. Repository-wide search is exceptional and should be tied to a specific unresolved risk.
|
||||
|
||||
The coding agent may perform lightweight self-check to report changed files and obvious forbidden-scope issues, but independent diff review belongs to `marionettist-reviewer`. The pre-done critic gate audits evidence and gate readiness; it does not redo the reviewer role.
|
||||
|
||||
For critic-gated work, review remains mandatory even if the critic already passed.
|
||||
|
||||
## Human Confirmation
|
||||
|
||||
Humans must confirm blocking business questions, scope tradeoffs, protected-area changes, compatibility breaks, and any requirement that cannot be inferred from existing code, docs, or rules.
|
||||
|
||||
The agent must also stop at these Marionettist gates:
|
||||
- after the analysis phase is complete, before coding starts
|
||||
- after each coding slice or approved parallel group has completed coding and review, before the next slice or group starts, unless the selected gate policy explicitly allows continuation for the next already-approved slice or group and no mandatory stop applies
|
||||
|
||||
Do not stop between small analysis steps such as intake, requirement freezing, inspection, slicing, and context-pack creation. Do not stop for temporary implementation substeps inside a coding slice, such as file batches, local test fixes, or slice-local refactoring.
|
||||
|
||||
## Mandatory Gate Behavior
|
||||
|
||||
At each Marionettist gate, the agent must output a short gate report with all of the following fields:
|
||||
- `Phase`
|
||||
- `Completed Work`
|
||||
- `Files Created or Changed`
|
||||
- `Validation Status`
|
||||
- `Recommended Next Step`
|
||||
- `User Confirmation Required`
|
||||
|
||||
When the completed work is a parallel slice group, the gate report must also state the group name, member slices, execution mode used, fallback order if used, shared files, and merge owner.
|
||||
|
||||
The final line must be exactly:
|
||||
|
||||
`User confirmation required to continue.`
|
||||
|
||||
## Priority Rule
|
||||
|
||||
This Marionettist workflow overrides any general default behavior that would otherwise continue automatically from analysis to coding or from one coding slice to the next. Coding may continue automatically into review only for the currently approved slice or group. Inter-slice continuation depends on the selected task policy and still cannot bypass any mandatory stop.
|
||||
|
||||
If instructions conflict, the agent must follow the Marionettist gates unless the user explicitly overrides them.
|
||||
|
||||
## Trivial Task Exception (Tier S)
|
||||
|
||||
A task may be Tier S when it is clearly scoped, localized, low-risk, and has no boundary ambiguity, compatibility concern, workflow impact, or need for task documents. It may include small docs-only corrections, typo/comment fixes, small tests or examples, harmless config text changes, or a localized one-file fix. If those low-risk conditions are not clearly true, treat the task as non-trivial.
|
||||
|
||||
## Agent Automation
|
||||
|
||||
Repository agents may inspect files, classify questions, write task docs, build context packs, slice implementation work, apply scoped code changes, run validation commands, and review diffs against allowed scope within the currently confirmed phase. They must not automatically cross from analysis to coding. They must not automatically cross from one coding slice or group to the next unless the selected gate policy explicitly allows continuation and no mandatory stop applies. They may automatically cross from coding into review only for the current approved slice or group.
|
||||
|
||||
## Agent Capability And Parallel Fallback
|
||||
|
||||
Parallel execution is optional and capability-dependent. For single-agent environments, it refers to processing independent file groups continuously within one approved coding phase.
|
||||
|
||||
Preferred uses for parallel execution:
|
||||
- parallel exploration during analysis
|
||||
- independent module or workflow inspection
|
||||
- independent investigation of logs, tests, or call paths
|
||||
- implementation of disjoint files inside an approved parallel slice group
|
||||
|
||||
Do not use parallel execution for:
|
||||
- trivial or low-risk tasks
|
||||
- shared-file edits without a clear merge owner
|
||||
- SQL or data migration steps that require strict ordering
|
||||
- public API or contract changes without an explicit serial owner
|
||||
- architecture-sensitive refactors without a dependency graph
|
||||
|
||||
If the current agent does not support subagents, or cannot safely coordinate parallel execution, it must execute the same approved work sequentially in dependency order.
|
||||
|
||||
`parallel-capable` means optional parallelism with a required sequential fallback, not a mandatory parallel execution model.
|
||||
|
||||
## Knowledge Policy
|
||||
|
||||
Docs explain design, architecture, functional behavior, workflow, and boundaries.
|
||||
|
||||
For current-vs-target knowledge:
|
||||
- `docs/current/` records observed current-state behavior, risk, and safe-change guidance
|
||||
- `docs/target/` records desired future design and migration intent
|
||||
- current-state docs should label fact, inference, and unknown when certainty matters
|
||||
- target-state guidance must not be treated as proof of current behavior
|
||||
|
||||
Use maturity to scale expectations, not to force unnecessary document volume:
|
||||
|
||||
- `L0-L1`: compact docs are acceptable if unknowns and risks are made explicit
|
||||
- `L2`: keep reusable area docs and routing reasonably current
|
||||
- `L3-L4`: keep docs, rules, and validation evidence more tightly aligned
|
||||
|
||||
For `knowledge.mode: mudball`, current-state capture is the default. L0 or L1 may be a valid steady state, and L2 is a reasonable gradual improvement point.
|
||||
|
||||
Docs must not become source-code indexes. Use IDE tools or local search for code navigation.
|
||||
|
||||
Context packs should record loaded context compactly under categories such as:
|
||||
- Global Rules
|
||||
- Knowledge Map Matches
|
||||
- Path-Proximity Rules
|
||||
- Excluded Context
|
||||
|
||||
When local path-proximity rules conflict with repository-global safety or boundary rules, the global rules win.
|
||||
|
||||
Rules define enforceable constraints. When adding, moving, renaming, or deleting docs or rules, update `docs/project/knowledge-map.md`.
|
||||
|
||||
## File Roles
|
||||
|
||||
- `AGENTS.md` defines repository-level workflow and constraint priority.
|
||||
- `.aiassistant/rules/*.md` contains enforceable agent constraints.
|
||||
- `docs/**/*.md` contains project knowledge and architecture explanations.
|
||||
- `docs/project/knowledge-map.md` is the routing index for ownership, docs, rules, and boundary notes.
|
||||
- `docs/current/**/*.md` contains current-state knowledge about how the project works today.
|
||||
- `docs/target/**/*.md` contains desired future design, migration direction, and proposed boundaries.
|
||||
- `.task/active.json` selects the current task and records phase, gate, and next-command summary.
|
||||
- `.task/<task-id>/requirement.md` freezes task requirements.
|
||||
- `.task/<task-id>/implementation-plan.md` defines executable implementation slices.
|
||||
- `.task/<task-id>/state.json` records durable task phase, status, gates, files, and current slice.
|
||||
- `.task/<task-id>/context-pack.md` contains the compact context for the current coding slice or approved parallel group.
|
||||
|
||||
Use the local task date for `<yyyy-MM-dd>`, for example `.task/2026-04-28/`. Keep task docs concise. Prefer references and distilled summaries over copying full source documents.
|
||||
|
||||
Legacy `.task/context-pack.md` is supported only as a migration fallback. Prefer the active task directory for all new context packs.
|
||||
|
||||
## Task State Contract
|
||||
|
||||
`taskId` is a relative task path under `.task/`, using `yyyy-MM-dd/task-slug` such as `2026-05-27/add-login`.
|
||||
|
||||
### `.task/active.json`
|
||||
|
||||
`active.json` is a flat pointer to the current task.
|
||||
|
||||
Support boundary:
|
||||
|
||||
- treat `active.json` as local to the current repository root or checked-out worktree
|
||||
- do not rely on implicit active-task lookup as cross-worktree subagent delegation context
|
||||
- this workflow does not by itself implement full runtime git-worktree scheduling
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `taskId` | string | yes | Active task path. |
|
||||
| `type` | string | no | Task classification: `feature`, `bugfix`, `refactor`, `documentation`, or `investigation`. |
|
||||
| `phase` | string | no | Current phase: `analysis`, `coding`, `review`, or `finalization`. |
|
||||
| `allowedToCode` | boolean | no | Whether the analysis-to-coding gate has been confirmed. |
|
||||
| `currentSlice` | string \| null | no | Currently approved slice identifier. |
|
||||
| `lastGate` | string \| null | no | Last gate where the agent stopped. |
|
||||
| `nextCommand` | string | no | Recommended next CLI command or skill action. |
|
||||
| `updatedAt` | string | no | Last update timestamp in ISO-8601 format. |
|
||||
|
||||
Example:
|
||||
|
||||
```json
|
||||
{
|
||||
"taskId": "2026-05-27/example-task",
|
||||
"type": "feature",
|
||||
"phase": "analysis",
|
||||
"allowedToCode": false,
|
||||
"currentSlice": null,
|
||||
"lastGate": null,
|
||||
"nextCommand": "/marionettist-context",
|
||||
"updatedAt": "2026-05-27T00:00:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
### `.task/<task-id>/state.json`
|
||||
|
||||
`state.json` records durable task execution state. Its `taskId` must match `.task/active.json.taskId`.
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `taskId` | string | yes | Same value as `.task/active.json.taskId`. |
|
||||
| `type` | string | no | Task classification: `feature`, `bugfix`, `refactor`, `documentation`, or `investigation`. |
|
||||
| `phase` | string | no | Current phase: `analysis`, `coding`, `review`, or `finalization`. |
|
||||
| `status` | string | no | Task status: `in_progress`, `completed`, or `blocked`. |
|
||||
| `allowedToCode` | boolean | no | Whether the analysis-to-coding gate has been confirmed. |
|
||||
| `currentSlice` | string \| null | no | Currently approved slice identifier. |
|
||||
| `gatePolicy` | object | no | Task-local gate policy record with fields such as `recommended`, `selected`, `reason`, and `finalApprovalRequired`. A task-local override changes the task's default gate posture only; it does not bypass required gates or explicit stop conditions. |
|
||||
| `slices` | object[] | no | Planned slices or approved groups for this task. |
|
||||
| `gates` | object | no | Gate booleans such as `requirementFrozen`, `planApproved`, `contextPackReady`, `criticPassed`, `implementationDone`, `reviewPassed`, and `validationPassed`. `criticPassed` records the plan-review critic gate, not permission to code by itself. |
|
||||
| `files` | object | no | Task artifact paths such as `requirement`, `implementationPlan`, and `contextPack`. |
|
||||
| `updatedAt` | string | no | Last update timestamp in ISO-8601 format. |
|
||||
|
||||
Example:
|
||||
|
||||
```json
|
||||
{
|
||||
"taskId": "2026-05-27/example-task",
|
||||
"type": "feature",
|
||||
"phase": "analysis",
|
||||
"status": "in_progress",
|
||||
"allowedToCode": false,
|
||||
"currentSlice": null,
|
||||
"gatePolicy": {
|
||||
"recommended": "balanced",
|
||||
"selected": null,
|
||||
"reason": "Default non-trivial task posture until a task-specific override is chosen.",
|
||||
"finalApprovalRequired": true
|
||||
},
|
||||
"slices": [],
|
||||
"gates": {
|
||||
"requirementFrozen": false,
|
||||
"planApproved": false,
|
||||
"contextPackReady": false,
|
||||
"criticPassed": false,
|
||||
"implementationDone": false,
|
||||
"reviewPassed": false,
|
||||
"validationPassed": false
|
||||
},
|
||||
"files": {
|
||||
"requirement": ".task/2026-05-27/example-task/requirement.md",
|
||||
"implementationPlan": ".task/2026-05-27/example-task/implementation-plan.md",
|
||||
"contextPack": ".task/2026-05-27/example-task/context-pack.md"
|
||||
},
|
||||
"updatedAt": "2026-05-27T00:00:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
### `state.json` slice entry shape
|
||||
|
||||
When `state.json.slices` is used, each slice entry may record gate-policy hints for that slice or approved group.
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `id` | string | yes | Slice or approved group identifier. |
|
||||
| `status` | string | no | Slice status such as `pending`, `in_progress`, `completed`, or `blocked`. |
|
||||
| `gateClass` | string | no | Frozen gate hint vocabulary. Use only `simple`, `standard`, `boundary-sensitive`, or `high-risk`. |
|
||||
| `risk_score` | integer | no | Supplemental per-slice risk score from `1` to `5`. It may preserve or strengthen a pause relative to `gateClass`, but must not weaken required stops or replace `gateClass`. |
|
||||
| `gateReasons` | string[] | no | Short reason labels that explain the gate posture for the slice or group, including any stricter pause signaled by `risk_score` when relevant. |
|
||||
|
||||
Example:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "slice-2-policy-aware-task-artifacts-skills",
|
||||
"status": "in_progress",
|
||||
"gateClass": "boundary-sensitive",
|
||||
"risk_score": 4,
|
||||
"gateReasons": ["agent-instructions", "task-state-contract"]
|
||||
}
|
||||
```
|
||||
|
||||
Agents may preserve extra project-local fields, but must not change the meaning of the fields above.
|
||||
|
||||
### Delegation Boundary For Parallel Or Worktree-Aware Execution
|
||||
|
||||
When a builder, orchestrator, or primary agent delegates work across subagents, especially with parallel execution or multiple worktrees, it should preflight task context once before delegation.
|
||||
|
||||
Cross-worktree delegation should use an explicit compact `taskEnvelope` instead of asking delegated agents to rediscover context through implicit `.task/active.json` lookup. That `taskEnvelope` should include at least:
|
||||
|
||||
- `worktreeRoot`
|
||||
- `taskId`
|
||||
- `phase`
|
||||
- `allowedToCode`
|
||||
- `currentSlice` or approved parallel group
|
||||
- `artifactPaths`
|
||||
- allowed scope and forbidden scope when relevant
|
||||
|
||||
Delegated agents should then:
|
||||
|
||||
- use the provided `taskEnvelope` as the task-context source
|
||||
- read only the referenced artifacts with bounded reads
|
||||
- return `CONTEXT_UNAVAILABLE` when context is missing, inaccessible, stale, or ambiguous
|
||||
- treat empty or cancelled delegation as a bounded stop condition rather than retrying in a loop
|
||||
|
||||
The primary agent remains responsible for surfacing bounded delegation failure clearly and stopping for user or orchestrator handling when safe context cannot be established.
|
||||
|
||||
## Framework-Managed Install And OpenCode Notes
|
||||
|
||||
When this project was installed or upgraded through Marionettist, `.marionettist/manifest.json` is the ownership record for framework-managed files.
|
||||
|
||||
Install/distribution modes:
|
||||
|
||||
- `embedded` — default for new installs and the closest match to legacy behavior
|
||||
- `hybrid` — local install with explicit adapter-aware distribution metadata
|
||||
- `adapter` — adapter-oriented install while keeping local manifest-based safety checks
|
||||
|
||||
When recorded, the mode appears in `.marionettist/manifest.json` as `distributionMode`. `marionettist.config.yaml` may mirror it under `distribution.mode` for readability. Legacy installs without manifest `distributionMode` remain valid; `marionettist diff`, `marionettist sync`, and `marionettist doctor` may report or infer the effective mode. The field is written only when the user explicitly selects or provides a mode, when the manifest already contains `distributionMode`, or when `marionettist.config.yaml` specifies `distribution.mode`.
|
||||
|
||||
For optional OpenCode assets:
|
||||
|
||||
- the framework OpenCode template source of truth is `templates/pathways/opencode/**` in the framework distribution
|
||||
- managed entries may record metadata such as `adapter`, `commandSurface`, `templateHash`, `renderedHash`, and legacy `hash`
|
||||
- safe comparison uses `renderedHash ?? hash` for compatibility with older manifests
|
||||
- local edits, missing files, conflicts, and orphaned managed entries are reported rather than silently overwritten
|
||||
- force-style replacement must be explicit
|
||||
|
||||
Canonical model profile source:
|
||||
|
||||
- `.marionettist/model-profiles.yml` is the canonical source when present
|
||||
- `marionettist.config.yaml` `models.profiles.*` is legacy fallback only when the canonical file is absent
|
||||
- `marionettist sync` may restore or re-render the canonical file and OpenCode agent files from effective profile values
|
||||
- `marionettist doctor` reports drift and whether expected model values came from the canonical file or the legacy fallback
|
||||
|
||||
OpenCode command surfaces:
|
||||
|
||||
- `minimal` — `/marionettist`, `/marionettist-dev`, `/marionettist-incident`, `/marionettist-docs`, `/marionettist-config`
|
||||
- `standard` — minimal plus `/marionettist-context`, `/marionettist-status`, `/marionettist-continue`
|
||||
- `advanced` — standard plus `/marionettist-feature`, `/marionettist-bugfix`, `/marionettist-refactor`
|
||||
- legacy `full` is a compatibility alias for `advanced`
|
||||
|
||||
The intended default is builder-first usage through `/marionettist`; broader command surfaces are optional ergonomics layers.
|
||||
@@ -0,0 +1,220 @@
|
||||
# Tier Policy Workflow Design Draft
|
||||
|
||||
This document is an installed target-project design note for deferred workflow research. It is intentionally kept in core templates so projects can see the boundary between the implemented Tier-policy MVP and future workflow-engine ideas without mistaking the future design for active behavior.
|
||||
|
||||
It defines an MVP boundary for configurable Tier policy without implementing a general workflow DAG engine.
|
||||
|
||||
## Purpose
|
||||
|
||||
- keep Tier policy focused on task classification and workflow hints
|
||||
- preserve current gate vocabulary and gate-policy semantics
|
||||
- record where future workflow configurability would interact with existing Marionettist flow
|
||||
- give target projects a stable place to record future workflow questions without rewriting current Marionettist behavior docs
|
||||
|
||||
## Why This Document Is Installed
|
||||
|
||||
This file stays in the core installed docs set for now because it serves a project-neutral documentation role:
|
||||
|
||||
- it explains why `.marionettist/tier-policy.yml` exists without implying that Tier policy can already rewire execution
|
||||
- it separates current implemented workflow rules from deferred workflow-engine ideas
|
||||
- it gives target projects a safe reference when they want to discuss future extensibility or roadmap questions
|
||||
|
||||
Projects should treat this file as a target/future-facing design note, not as executable current-state behavior. The current source of truth for actual Marionettist execution remains `docs/project/marionettist-workflow.md` plus `marionettist.config.yaml` `gatePolicy`.
|
||||
|
||||
## Current Workflow Nodes
|
||||
|
||||
The current Marionettist workflow is a mostly fixed directed flow with a few policy-driven branches:
|
||||
|
||||
1. task intake and Tier classification
|
||||
2. analysis helpers as needed
|
||||
- requirement freezing when needed
|
||||
- workflow or module inspection when needed
|
||||
- implementation slicing when needed
|
||||
- context-pack creation
|
||||
3. analysis-to-coding gate
|
||||
4. approved slice execution
|
||||
5. automatic review for that same slice or approved group
|
||||
6. critic gates when required by Tier or risk
|
||||
7. slice gate or final gate
|
||||
|
||||
The existing Tier split is coarse-grained:
|
||||
|
||||
- Tier S: direct coding and review
|
||||
- Tier M: analysis plus context pack before coding
|
||||
- Tier L: full Marionettist flow with stricter gating and critic expectations
|
||||
|
||||
## Conceptual Agent And Skill I/O
|
||||
|
||||
Current workflow behavior can be described as node contracts rather than a configurable engine:
|
||||
|
||||
| Node | Inputs | Outputs |
|
||||
| --- | --- | --- |
|
||||
| Task intake | user request, repo rules, local config | Tier suggestion, task type, next Marionettist step |
|
||||
| Requirement freeze | unclear behavior or scope | requirement artifact or clarified stop condition |
|
||||
| Inspection | selected files, docs, rules | workflow/module findings and risk notes |
|
||||
| Implementation slicing | requirements, findings | approved slices or groups with gate hints |
|
||||
| Context-pack build | active task artifacts, relevant docs/rules | `.task/<task-id>/context-pack.md` |
|
||||
| Coding | approved slice, context pack | scoped file changes and slice validation evidence |
|
||||
| Review | changed-file inventory, approved scope | scope verdict, risk notes, follow-up actions |
|
||||
| Critic gate | task artifacts, review/validation evidence | gate verdict and missing-evidence report |
|
||||
|
||||
This framing keeps node responsibilities stable even if later Tier policy adds more configurable routing hints.
|
||||
|
||||
## Where Tier Policy Can Safely Influence Flow
|
||||
|
||||
An MVP Tier policy can safely influence only advisory decisions such as:
|
||||
|
||||
- how a task is classified by Tier
|
||||
- what level of analysis is recommended
|
||||
- whether critic use is suggested or expected
|
||||
- what model profile role is preferred
|
||||
- what workflow hint label best matches the task
|
||||
|
||||
The MVP should not let Tier policy directly redefine gates, invent new gate classes, or bypass required human confirmation.
|
||||
|
||||
## Workflow DAG Configuration Complexity
|
||||
|
||||
Full workflow DAG configurability is deferred because it introduces multiple coupled concerns at once:
|
||||
|
||||
1. **Node contract stability**: configurable edges require stable, documented input/output contracts for every skill and agent handoff.
|
||||
2. **Safety invariants**: some edges are not optional, such as analysis before non-trivial coding and human confirmation at mandatory gates.
|
||||
3. **Conflict handling**: user-configured routing could contradict safer defaults or create ambiguous paths.
|
||||
4. **Execution semantics**: optional, required, repeated, and parallel nodes need a clear state model.
|
||||
5. **Validation semantics**: different paths would need explicit rules for what counts as sufficient review, critic evidence, and final validation.
|
||||
6. **Template portability**: a project-neutral framework must avoid encoding stack-specific workflows while still remaining understandable.
|
||||
|
||||
Because these concerns are intertwined, a full DAG engine would be a separate design and implementation track, not an incidental extension of Tier policy.
|
||||
|
||||
## MVP Proposal
|
||||
|
||||
For the configurable Tier policy MVP:
|
||||
|
||||
- keep the executable workflow fixed as documented in `docs/project/marionettist-workflow.md`
|
||||
- allow Tier policy to provide **workflow hints**, not executable graph rewrites
|
||||
- keep gate behavior under `gatePolicy` and existing workflow rules
|
||||
- keep critic requirements expressed as current workflow expectations, not arbitrary user-defined nodes
|
||||
- allow builder/config flows to explain which current path was chosen and why
|
||||
- allow builder/config flows to turn natural-language policy requests into candidate YAML only after showing a diff and waiting for explicit persistence confirmation
|
||||
|
||||
Recommended hint categories for later implementation work:
|
||||
|
||||
- `workflowHint`: labels such as direct, analysis-context, or full-marionettist
|
||||
- `reviewLevel`: labels such as standard or critic-required
|
||||
- `modelProfileHint`: existing model profile role/name only
|
||||
- `gateHint`: advisory only; must not replace `gatePolicy`
|
||||
|
||||
## Implemented MVP Boundary Vs Deferred Hardening
|
||||
|
||||
Implemented MVP behavior today:
|
||||
|
||||
- `.marionettist/tier-policy.yml` is the installed project-local Tier-policy file
|
||||
- framework defaults remain available when the project file is missing
|
||||
- parse and validation problems fall back to safer framework behavior with explanation
|
||||
- conflict handling distinguishes refinements, explicit overrides, soft conflicts, and unsafe downgrades
|
||||
- natural-language policy requests go through candidate YAML, diff display, and explicit confirmation before persistence
|
||||
|
||||
Deferred future hardening beyond the MVP:
|
||||
|
||||
- cross-validating every `modelProfileHint` against `.marionettist/model-profiles.yml`
|
||||
- stricter automatic rejection of unknown ordered-field values instead of the current conservative explanation/fallback posture
|
||||
- a full configurable workflow DAG or workflow-engine state model
|
||||
|
||||
## Concrete MVP Schema Freeze
|
||||
|
||||
The current MVP freezes the project-local Tier policy file as `.marionettist/tier-policy.yml` with this shape:
|
||||
|
||||
```yaml
|
||||
schemaVersion: "1"
|
||||
tiers:
|
||||
S:
|
||||
description: "..."
|
||||
matchRules:
|
||||
- "..."
|
||||
minTier: null
|
||||
maxTier: "S"
|
||||
workflowHint: "direct"
|
||||
gateHint: "default"
|
||||
reviewLevel: "standard"
|
||||
modelProfileHint: "build"
|
||||
M:
|
||||
description: "..."
|
||||
matchRules:
|
||||
- "..."
|
||||
minTier: "M"
|
||||
maxTier: "M"
|
||||
workflowHint: "analysis-context"
|
||||
gateHint: "default"
|
||||
reviewLevel: "standard"
|
||||
modelProfileHint: "build"
|
||||
L:
|
||||
description: "..."
|
||||
matchRules:
|
||||
- "..."
|
||||
minTier: "L"
|
||||
maxTier: null
|
||||
workflowHint: "full-marionettist"
|
||||
gateHint: "prefer-strict"
|
||||
reviewLevel: "critic-required"
|
||||
modelProfileHint: "think"
|
||||
```
|
||||
|
||||
Schema rules for dependent slices:
|
||||
|
||||
- `schemaVersion` is required and currently fixed to string `"1"`
|
||||
- `tiers` is required
|
||||
- tier keys are fixed to `S`, `M`, and `L`; the MVP does not add custom tier names
|
||||
- `description`, `matchRules`, `workflowHint`, `gateHint`, `reviewLevel`, and `modelProfileHint` are required for each tier
|
||||
- `minTier` and `maxTier` are optional and may be `S`, `M`, `L`, or `null`
|
||||
- `matchRules` is a plain string list; no inline maps or nested rule objects
|
||||
|
||||
Precedence and boundary notes:
|
||||
|
||||
- framework defaults remain the fallback when the file is missing
|
||||
- project-local file content is an override/refinement layer for Tier classification and hints only
|
||||
- `tiers.<tier>.gateHint` is advisory and must not replace `gatePolicy.defaultMode` or the selected task gate policy
|
||||
- `tiers.<tier>.modelProfileHint` must reference an existing model-profile role/name and must not carry provider/model IDs
|
||||
- refinements should be auto-accepted with rationale, explicit overrides should be surfaced clearly, and unsafe downgrades should fall back to framework defaults rather than silently accepted
|
||||
|
||||
## Natural-Language Candidate Workflow Boundary
|
||||
|
||||
The MVP natural-language authoring path is intentionally narrow:
|
||||
|
||||
1. user describes desired Tier-policy changes in prose
|
||||
2. builder/config workflow drafts candidate `.marionettist/tier-policy.yml` content
|
||||
3. builder shows the candidate and a diff against the current file or framework defaults
|
||||
4. builder includes any already-available conflict or override explanation relevant to the candidate
|
||||
5. builder stops for explicit confirmation before writing
|
||||
|
||||
This is a guided config-authoring workflow, not a new standalone CLI command and not a general workflow-DAG editor.
|
||||
|
||||
Parser-compatibility boundary for this schema:
|
||||
|
||||
- no anchors
|
||||
- no merge keys
|
||||
- no multi-document YAML
|
||||
- no complex inline YAML structures
|
||||
|
||||
## Deferred Boundaries
|
||||
|
||||
The following remain out of scope for the MVP and should be deferred beyond Tier-policy basics:
|
||||
|
||||
- user-defined workflow nodes
|
||||
- arbitrary edge rewiring between existing nodes
|
||||
- per-project replacement of mandatory Marionettist gates
|
||||
- new gate vocabulary or numeric workflow scoring
|
||||
- a standalone workflow-DAG execution engine
|
||||
- automatic persistence of natural-language workflow changes without explicit confirmation
|
||||
|
||||
## Suggested Future Design Questions
|
||||
|
||||
If a later slice explicitly explores configurable workflow execution, it should answer:
|
||||
|
||||
1. Which workflow edges are hard invariants versus configurable suggestions?
|
||||
2. Which node contracts are stable enough to expose in project-neutral templates?
|
||||
3. How are invalid or unsafe workflow graphs detected and explained?
|
||||
4. How does task state record active path selection without making `state.json` engine-specific too early?
|
||||
5. How do parallel groups interact with configurable routing while preserving sequential fallback?
|
||||
|
||||
## Summary
|
||||
|
||||
Tier policy should first become a safe classification-and-hints layer. A full configurable workflow DAG is a separate future capability that should begin only after the framework freezes node contracts, safety invariants, and validation semantics.
|
||||
Reference in new issue
Block a user