Refine sm-flow trigger and scale rules

This commit is contained in:
aruo
2026-07-05 14:30:15 +08:00
parent 433f7a93a4
commit e4f6e013a5
28 changed files with 937 additions and 105 deletions
@@ -0,0 +1,48 @@
# Validate SM Flow Explicit Trigger Acceptance
## Result
Accepted and archived.
## Static Validation
- Trigger rule verification:
- `SKILL.md` frontmatter says sm-flow is only used for explicit `/sm-flow` commands or explicit natural-language requests.
- `SKILL.md` trigger section says task type alone must not auto-trigger sm-flow.
- `operating-rules.md` startup checks now include explicit natural-language requests.
- Scale source verification:
- Scale definition scan found `standard`, `micro`, and `complex` definition headings and definition phrases only in `references/scales.md`.
- Other files refer to `references/scales.md` instead of redefining the scale rules.
- Obsolete wording verification:
- No matches for minute/hour/second/timebox metrics.
- No matches for old skip semantics or old fixed `proposal.md + design.md` expression.
- No matches for old conflict wording targeted by this validation.
## Script Validation
- Passed: `python C:/Users/兜/.codex/skills/.system/skill-creator/scripts/quick_validate.py .agents/skills/sm-flow`
- Passed: reference integrity scan for `references/*.md`.
## Browser Or Manual Validation
- Not applicable. This change only modifies skill protocol text and validation records.
## Unverified
- Real external OpenSpec CLI integration was not executed because the current tool surface does not expose those child commands.
- Forward-testing with an independent subagent was not run in this pass.
## Fixed During Apply
- Replaced remaining hard-coded `design.md` wording in phase/audit fallback rules where the protocol must respect scale-specific design artifacts.
- Added explicit natural-language sm-flow requests to startup checks.
## OpenSpec Archive
- `.archive-ready` is present.
- User confirmed archive.
- Archived location: `openspec/archive/2026-07-05-validate-sm-flow-explicit-trigger/`.
- Status: `archived`.
- Archive method: local filesystem archive following existing repository convention because external `openspec-archive-change` is not directly callable in the current tool surface.
@@ -0,0 +1,29 @@
# Validate SM Flow Explicit Trigger Brief
## Background
`sm-flow` was simplified so it should only run on explicit user invocation. Related cleanup centralized scale rules, removed time-based metrics, and separated fallback/glossary details into references.
## Goal
Validate the current `sm-flow` design by running a real micro OpenSpec change through Discover, Commit, Apply, and Archive.
## Scope
- Validate `.agents/skills/sm-flow/SKILL.md`.
- Validate `.agents/skills/sm-flow/references/*.md`.
- Fix any protocol inconsistency found during validation.
- Record fallback capability source because external OpenSpec commands are unavailable in the current tool surface.
## Non-Goals
- No business code changes.
- No changes to the four visible checkpoints or nine internal phases.
- No automatic trigger heuristics.
- No historical archive rewrites.
## Scale
- Scale: `micro`.
- Evidence is folded into `decisions.md`.
- Linked OpenSpec change: `openspec/changes/validate-sm-flow-explicit-trigger/`.
@@ -0,0 +1,72 @@
# Validate SM Flow Explicit Trigger Decisions
## Capability Source
- Discover: sm-flow built-in protocol.
- Propose/specify/apply/archive: fallback protocol from `.agents/skills/sm-flow/references/fallbacks.md`.
- Missing external capability: OpenSpec CLI and OpenSpec child skills are not directly callable from the current tool surface.
- Impact: validation is file-based and static; it can verify current protocol text and artifacts but cannot exercise a real external OpenSpec command.
- Remaining risk: future tool availability may require rechecking integration behavior.
## Context
- `devflow/index.md` contains related sm-flow history:
- `dev-flow-skill-evaluation`
- `sm-flow-v3-1-upgrade`
- `sm-flow-execution-hardening`
- `devflow/glossary/CONTEXT.md` is project-level glossary and does not define sm-flow protocol terms.
- Current validation change is new: `validate-sm-flow-explicit-trigger`.
## Scale Decision
- Scale: `micro`.
- Reason: documentation/protocol validation only, no business code, no external interface contract change.
- Interface impact: L1 internal documentation/protocol validation.
- Micro constraints retained: proposal, specs, tasks, commit gate, apply verification, devflow archive, archive confirmation.
## Question Pool
| Question | Mode | Status | Result |
| --- | --- | --- | --- |
| Does top-level trigger text require explicit sm-flow invocation only? | evidence-driven | confirmed | `SKILL.md` frontmatter and trigger section both state explicit invocation only. |
| Are scale definitions centralized in `references/scales.md`? | evidence-driven | confirmed | Scan for scale definition headings and definition phrases only matched `references/scales.md`. |
| Are time/minute metrics absent from skill rules? | evidence-driven | confirmed | Obsolete time metric scan returned no matches. |
| Does fallback usage remain explicit and recorded? | evidence-driven | confirmed | This file records fallback source, impact, and remaining risk. |
| Is user confirmation needed for product scope? | user-interview | not required | User already requested this validation run; no unresolved product preference blocks this micro validation. |
## Cross-Artifact Alignment
| Link | Status | Notes |
| --- | --- | --- |
| brief/prd -> proposal | not applicable | Micro validation has no separate brief/prd before archive. |
| proposal -> design artifact | aligned | Proposal contains inline micro design notes. |
| design artifact -> specs | aligned | Specs cover explicit trigger, scale source, no time metrics, and fallback recording. |
| specs -> tasks | aligned | Tasks include scans, validation, patching if needed, and archive handoff. |
## Commit Gate
- Passed.
- Proposal explains why, what, scope, non-goals, inline design, and risks.
- Specs describe observable validation behavior.
- Tasks are executable and have validation evidence.
- Cross-artifact alignment has no unresolved gap.
- `.committed` created.
## Apply Log
- Validation found one consistency issue: `phase-contracts.md` still hard-coded `design.md` in specify/audit wording even though `scales.md` allows micro changes to use an equivalent inline design section.
- Fix applied: changed those references to "设计产物" where the rule must respect the current scale.
- Fix applied: `fallbacks.md` audit fallback now says to repair the design artifact instead of only `design.md`.
- Fix applied: `operating-rules.md` startup checks now include explicit natural-language requests to use sm-flow.
- Validation commands passed:
- `python C:/Users/兜/.codex/skills/.system/skill-creator/scripts/quick_validate.py .agents/skills/sm-flow`
- reference integrity scan for `references/*.md`
- obsolete wording scan for time metrics, old skip semantics, old conflict wording, and fixed `design.md` expressions.
- scale definition duplication scan.
## Archive Log
- User confirmed OpenSpec archive.
- External `openspec-archive-change` was not directly callable in the current tool surface.
- Archived by moving the OpenSpec change to `openspec/archive/2026-07-05-validate-sm-flow-explicit-trigger/`, matching existing repository archive convention.
- `devflow/index.md` status updated to `archived`.
@@ -0,0 +1,33 @@
# Validate SM Flow Standard Change Acceptance
## Result
Accepted and archived.
## Static Validation
- Scale rule centralization passed.
- Obsolete wording scan passed.
- Standard artifact completeness passed.
- Cross-artifact alignment passed.
## Script Validation
- Passed: skill quick validation.
- Passed: reference integrity scan.
## Browser Or Manual Validation
- Not applicable. This validation covers skill protocol files and OpenSpec/devflow records.
## Unverified
- External OpenSpec CLI integration.
- Independent forward-testing by a separate agent.
## OpenSpec Archive
- User confirmed archive.
- Archived location: `openspec/archive/2026-07-05-validate-sm-flow-standard-change/`.
- Status: `archived`.
- Archive method: local filesystem archive following existing repository convention because external `openspec-archive-change` is not directly callable in the current tool surface.
@@ -0,0 +1,25 @@
# Validate SM Flow Standard Change Brief
## Background
The micro validation confirmed the reduced path. This record validates the normal standard path, where independent design and separate evidence are required.
## Goal
Confirm that the current `sm-flow` skill supports a standard change with complete OpenSpec and devflow artifacts.
## Scope
- Validate standard artifact requirements.
- Validate scale rule centralization.
- Validate skill structure and reference integrity.
## Non-Goals
- No business code changes.
- No archive move without user confirmation.
- No complex migration, rollback, or cross-team interface test.
## Linked OpenSpec
`openspec/changes/validate-sm-flow-standard-change/`
@@ -0,0 +1,52 @@
# Validate SM Flow Standard Change Decisions
## Capability Source
- This is an ordinary engineering validation, not an explicit sm-flow invocation.
- External OpenSpec child commands are not directly callable in the current tool surface.
- Validation uses file-based OpenSpec fixtures and static/script checks.
## Scale Decision
- Scale: `standard`.
- Reason: this validation intentionally exercises the full normal artifact set: proposal, independent design, specs, tasks, and separate evidence.
- Interface impact: L1 internal documentation/protocol validation.
## Question Pool
| Question | Mode | Status | Result |
| --- | --- | --- | --- |
| Does standard require independent `design.md`? | evidence-driven | confirmed | `references/scales.md` defines independent `design.md` for standard. |
| Does standard require separate `evidence.md` in devflow? | evidence-driven | confirmed | `references/scales.md` defines `brief.md`, `evidence.md`, `decisions.md`, `acceptance.md`. |
| Are standard scale definitions duplicated outside `scales.md`? | evidence-driven | confirmed | Scale definition scan matched complete scale definitions only in `references/scales.md`. |
| Is user scope confirmation needed? | user-interview | not required | User asked to validate a regular change; no product scope choice is blocked. |
## Cross-Artifact Alignment
| Link | Status | Notes |
| --- | --- | --- |
| proposal -> design | aligned | Proposal asks for standard artifact validation; design defines standard artifact model. |
| design -> specs | aligned | Specs require full OpenSpec artifacts, evidence archive, and centralized scale definitions. |
| specs -> tasks | aligned | Tasks include fixture creation, validation scans, commit gate, and devflow records. |
## Findings
- Standard OpenSpec artifact completeness passed: `proposal.md`, independent `design.md`, spec file, and `tasks.md` exist.
- Cross-artifact alignment passed: proposal -> design -> specs -> tasks.
- Scale duplication scan passed.
- Obsolete wording scan passed.
- Skill quick validation passed.
- Reference integrity scan passed.
## Commit Gate
- `.committed` created.
- Status: committed standard validation fixture.
## Archive Status
- Devflow standard records created.
- User confirmed OpenSpec archive.
- External `openspec-archive-change` was not directly callable in the current tool surface.
- Archived by moving the OpenSpec change to `openspec/archive/2026-07-05-validate-sm-flow-standard-change/`, matching existing repository archive convention.
- `devflow/index.md` status updated to `archived`.
@@ -0,0 +1,34 @@
# Validate SM Flow Standard Change Evidence
## Static Evidence
- Scale definition scan found complete `standard / micro / complex` definition headings and definition phrases only in `.agents/skills/sm-flow/references/scales.md`.
- Obsolete wording scan returned no matches for:
- minute/hour/second/timebox metrics
- old skip semantics
- old fixed `proposal.md + design.md` expression
- old conflict wording targeted by prior validation
## Script Evidence
- Passed: `python C:/Users/兜/.codex/skills/.system/skill-creator/scripts/quick_validate.py .agents/skills/sm-flow`
- Passed: `references/*.md` integrity scan.
## Artifact Evidence
- OpenSpec standard artifacts exist:
- `openspec/changes/validate-sm-flow-standard-change/proposal.md`
- `openspec/changes/validate-sm-flow-standard-change/design.md`
- `openspec/changes/validate-sm-flow-standard-change/specs/sm-flow-standard-change/spec.md`
- `openspec/changes/validate-sm-flow-standard-change/tasks.md`
- Devflow standard artifacts exist:
- `brief.md`
- `evidence.md`
- `decisions.md`
- `acceptance.md`
## Limits
- This validation is static/file-based.
- It does not run a real external OpenSpec CLI command.
- It does not include independent subagent forward-testing.