* test(#2734): failing-first suite for the statusline STATE.md freshness marker Binds the contract before any hook change exists: a `state ~N commits back` segment gated on the state_head stamp landed by #2622, firing at the same advisory threshold /gsd-health's W024 uses rather than at > 0. Covers all five acceptance criteria — threshold parity (19/20/21 boundaries), both renderers including formatGsdStateCompact, an exact spawn-count assertion, repo-pinning and sub_repos degradation, and behavioral parity against readStateHeadFreshness rather than a source-grep of the two fence copies. 52 example-based tests plus 5 seeded fast-check properties. Red now by design. * feat(#2734): surface STATE.md commit-age on the statusline Adds an opt-in `state ~N commits back` marker to the GSD-state segment, consuming the `state_head` stamp and freshness contract landed by #2622. A solo developer returning to a project reads "Phase 4, executing" in STATE.md and acts on it, without noticing the codebase moved 40 commits since that line was written. /gsd-health reports it as W024, but only if you think to run it; the statusline is the surface you see without asking. Fires at STATE_HEAD_ADVISORY_COMMITS (20), the same threshold W024 uses, not at > 0: with commit_docs:true the commit carrying a STATE.md sync advances HEAD by one, so > 0 would alarm permanently on a fresh project. Costs exactly one bounded git subprocess per render and none when disabled. `rev-list --left-right --count` answers ancestry and distance together, and repo pinning is a filesystem check mirroring projectOwnsItsRepo rather than a --show-toplevel compare, which is unreliable on macOS /private/var and Windows 8.3 paths. Every unresolvable input degrades to the tri-state unknown -- the marker is absent, never a "fresh" claim the project cannot substantiate: a malformed stamp, a root that does not own its .git, a sub_repos workspace, history rewound past the stamp, or git being unavailable. Also collapses statusline config resolution onto one resolveStatuslineOptions() seam. runStatusline() and renderStatusline() duplicated it byte-for-byte; one copy is what keeps a newly-added key from reaching only one of them. * test(#2734): route the e2e spawn through the process seam and fix fixture leaks Review findings from the two orthogonal passes: - `bothEntryPointsResolveOptionsIdentically` spawned a child and substring-matched its stdout to test a pure function. It now calls resolveStatuslineOptions() directly — no subprocess, no text matching. - `skipsFreshnessWorkWhenTodoTaskActive` genuinely needs a child (the !task gate lives in runStatusline, which reads stdin), so it now spawns through tests/helpers/process-seam.cjs and proves the negative with a filesystem fact: the git shim appends to a marker file on every invocation, and the assertion is that the marker never appears. Stronger than asserting text is missing, and it drops the last stdout substring match in the block. - Every fixture-creating test now registers `t.after(() => cleanup(dir))` instead of a trailing cleanup(dir), which leaked the temp repo on assertion failure. derivationAgreesWithStateModule reassigns `dir` across five fixtures, so it binds each directory at scheduling time rather than cleaning only the last. Also corrects markerCoexistsWithMilestoneComplete, which asserted the wrong expectation rather than finding a code defect: `percent` drives the progress bar too, so the milestone segment reads "v1.9 [##########] 100%". The marker appends after it, which is what the test exists to prove. CONTEXT.md's opt-in statusline key list was missing statusline.show_git as well as the new key; both are now enumerated. * docs(#2734): backfill changeset PR number (#3700) --------- Co-authored-by: sim <sim@local>
195 lines
6.9 KiB
JSON
195 lines
6.9 KiB
JSON
{
|
|
"_comment": "Canonical schema manifest for valid config key paths. This manifest is the single CJS source of truth for valid config keys; dynamicKeyPatterns source strings are recompiled to RegExp at runtime by config-schema.cjs. runtimeStateKeys mirrors RUNTIME_STATE_KEYS.",
|
|
"validKeys": [
|
|
"mode",
|
|
"granularity",
|
|
"parallelization",
|
|
"commit_docs",
|
|
"model_profile",
|
|
"search_gitignored",
|
|
"brave_search",
|
|
"firecrawl",
|
|
"exa_search",
|
|
"tavily_search",
|
|
"ref_search",
|
|
"perplexity",
|
|
"jina",
|
|
"workflow.plan_check",
|
|
"workflow.verifier",
|
|
"workflow.auto_advance",
|
|
"workflow.node_repair",
|
|
"workflow.node_repair_budget",
|
|
"workflow.smart_zone_tokens",
|
|
"workflow.human_verify_mode",
|
|
"workflow.text_mode",
|
|
"workflow.research_before_questions",
|
|
"workflow.discuss_mode",
|
|
"workflow.skip_discuss",
|
|
"workflow.auto_prune_state",
|
|
"workflow.use_worktrees",
|
|
"workflow.worktree_skip_hooks",
|
|
"workflow.code_review_command",
|
|
"workflow.code_review_depth_overrides",
|
|
"workflow.plan_bounce",
|
|
"workflow.plan_bounce_script",
|
|
"workflow.plan_bounce_passes",
|
|
"workflow.plan_chunked",
|
|
"workflow.specless_probe_fallback",
|
|
"workflow.plan_review_convergence",
|
|
"workflow.agent_hint_routing",
|
|
"code_quality.fallow.enabled",
|
|
"code_quality.fallow.scope",
|
|
"code_quality.fallow.profile",
|
|
"code_quality.fallow.mcp",
|
|
"ship.pr_body_sections",
|
|
"git.branching_strategy",
|
|
"git.base_branch",
|
|
"git.create_tag",
|
|
"git.phase_branch_template",
|
|
"git.milestone_branch_template",
|
|
"git.quick_branch_template",
|
|
"planning.commit_docs",
|
|
"planning.search_gitignored",
|
|
"planning.sub_repos",
|
|
"review.default_reviewers",
|
|
"review.max_prompt_tokens",
|
|
"review.max_prompt_tokens_per_reviewer",
|
|
"workflow.cross_ai_execution",
|
|
"workflow.cross_ai_command",
|
|
"workflow.cross_ai_timeout",
|
|
"workflow.subagent_timeout",
|
|
"workflow.test_gate_timeout",
|
|
"workflow.test_command",
|
|
"workflow.build_command",
|
|
"workflow.mvp_mode",
|
|
"workflow.context_guard_mode",
|
|
"executor.stall_detect_interval_minutes",
|
|
"executor.stall_threshold_minutes",
|
|
"planner.stall_detect_interval_minutes",
|
|
"planner.stall_threshold_minutes",
|
|
"workflow.inline_plan_threshold",
|
|
"hooks.context_warnings",
|
|
"hooks.workflow_guard",
|
|
"workflow.context_coverage_gate",
|
|
"statusline.show_last_command",
|
|
"statusline.context_position",
|
|
"statusline.show_context_tokens",
|
|
"statusline.state_format",
|
|
"statusline.show_git",
|
|
"statusline.show_state_freshness",
|
|
"workflow.max_discuss_passes",
|
|
"features.thinking_partner",
|
|
"context",
|
|
"features.global_learnings",
|
|
"learnings.max_inject",
|
|
"project_code",
|
|
"phase_id_convention",
|
|
"phase_naming",
|
|
"manager.flags.discuss",
|
|
"manager.flags.plan",
|
|
"manager.flags.execute",
|
|
"response_language",
|
|
"context_window",
|
|
"graphify.build_timeout",
|
|
"graphify.auto_update",
|
|
"graphify.graph_path",
|
|
"claude_md_path",
|
|
"claude_md_assembly.mode",
|
|
"runtime",
|
|
"resolve_model_ids",
|
|
"effort.default",
|
|
"fast_mode.enabled",
|
|
"plan_review.source_grounding",
|
|
"plan_review.source_grounding_authority",
|
|
"model_policy.provider",
|
|
"model_policy.budget",
|
|
"model_policy.high",
|
|
"model_policy.medium",
|
|
"model_policy.low",
|
|
"agent_skills_security.trusted_global_roots",
|
|
"capabilities.strict_known_registries",
|
|
"capabilities.auto_update",
|
|
"security.injection_blocking"
|
|
],
|
|
"runtimeStateKeys": [
|
|
"workflow._auto_chain_active"
|
|
],
|
|
"dynamicKeyPatterns": [
|
|
{
|
|
"topLevel": "agent_skills",
|
|
"source": "^agent_skills\\.[a-zA-Z0-9_-]+$",
|
|
"description": "agent_skills.<agent-type>"
|
|
},
|
|
{
|
|
"topLevel": "features",
|
|
"source": "^features\\.[a-zA-Z0-9_]+$",
|
|
"description": "features.<feature_name>"
|
|
},
|
|
{
|
|
"topLevel": "claude_md_assembly",
|
|
"source": "^claude_md_assembly\\.blocks\\.[a-zA-Z0-9_]+$",
|
|
"description": "claude_md_assembly.blocks.<section>"
|
|
},
|
|
{
|
|
"topLevel": "model_profile_overrides",
|
|
"source": "^model_profile_overrides\\.[a-zA-Z0-9_-]+\\.(opus|sonnet|haiku)$",
|
|
"description": "model_profile_overrides.<runtime>.<opus|sonnet|haiku>"
|
|
},
|
|
{
|
|
"topLevel": "models",
|
|
"source": "^models\\.(planning|discuss|research|execution|verification|completion)$",
|
|
"description": "models.<planning|discuss|research|execution|verification|completion>"
|
|
},
|
|
{
|
|
"topLevel": "granularities",
|
|
"source": "^granularities\\.(planning|discuss|research|execution|verification|completion)$",
|
|
"description": "granularities.<planning|discuss|research|execution|verification|completion>"
|
|
},
|
|
{
|
|
"topLevel": "dynamic_routing",
|
|
"source": "^dynamic_routing\\.(enabled|escalate_on_failure|max_escalations|provider_escalation|tier_models\\.(light|standard|heavy))$",
|
|
"description": "dynamic_routing.<enabled|escalate_on_failure|max_escalations|provider_escalation|tier_models.<light|standard|heavy>>"
|
|
},
|
|
{
|
|
"topLevel": "model_overrides",
|
|
"source": "^model_overrides\\.[a-zA-Z0-9_-]+$",
|
|
"description": "model_overrides.<agent-id>"
|
|
},
|
|
{
|
|
"topLevel": "effort",
|
|
"source": "^effort\\.routing_tier_defaults\\.(light|standard|heavy)$",
|
|
"description": "effort.routing_tier_defaults.<light|standard|heavy>"
|
|
},
|
|
{
|
|
"topLevel": "effort",
|
|
"source": "^effort\\.agent_overrides\\.[a-zA-Z0-9_-]+$",
|
|
"description": "effort.agent_overrides.<agent-id>"
|
|
},
|
|
{
|
|
"topLevel": "fast_mode",
|
|
"source": "^fast_mode\\.routing_tier_defaults\\.(light|standard|heavy)$",
|
|
"description": "fast_mode.routing_tier_defaults.<light|standard|heavy>"
|
|
},
|
|
{
|
|
"topLevel": "fast_mode",
|
|
"source": "^fast_mode\\.agent_overrides\\.[a-zA-Z0-9_-]+$",
|
|
"description": "fast_mode.agent_overrides.<agent-id>"
|
|
},
|
|
{
|
|
"topLevel": "review",
|
|
"source": "^review\\.reviewer_instances\\.[a-zA-Z0-9_-]+\\.(cli|model|agent)$",
|
|
"description": "review.reviewer_instances.<instance-name>.<cli|model|agent> (#1517)"
|
|
},
|
|
{
|
|
"topLevel": "model_policy",
|
|
"source": "^model_policy\\.runtime_tiers\\.[a-zA-Z0-9_-]+\\.(opus|sonnet|haiku)$",
|
|
"description": "model_policy.runtime_tiers.<runtime>.<opus|sonnet|haiku> (#3587)"
|
|
},
|
|
{
|
|
"topLevel": "phase_commit_docs",
|
|
"source": "^phase_commit_docs\\.\\d+[A-Z]?(?:\\.\\d+)*$",
|
|
"description": "phase_commit_docs.<phase-id> — per-phase commit_docs override (#3587). The <phase-id> segment is a hand-copy of the canonical PHASE_NUMBER_TOKEN_SOURCE grammar owned by src/phase-id.cts (#2128); this manifest is hand-maintained JSON so it cannot import that constant. Pinned against drift by the behavioral parity test in tests/commit-docs-bypass.test.cjs (folded 'phase-commit-docs' block, describe block 'E', #3587) — do not hand-edit this pattern without updating that test."
|
|
}
|
|
]
|
|
}
|