Skip to content

fix: stale stub diagnostics + remove reason_code from user-facing output#49

Merged
Li-Sanze merged 1 commit into
mainfrom
fix/stale-stub-diagnostics
May 28, 2026
Merged

fix: stale stub diagnostics + remove reason_code from user-facing output#49
Li-Sanze merged 1 commit into
mainfrom
fix/stale-stub-diagnostics

Conversation

@Li-Sanze
Copy link
Copy Markdown
Collaborator

What

Two independent fixes in one branch:

1. Stale stub diagnostics (DX improvement)

When a workspace stub references an old bundle_version that no longer exists in the installed payload, error messages were misleading — they said "refresh payload" when the real problem was a stale workspace stub.

Changes:

  • installer/bootstrap_workspace.py: added _stale_stub_diagnostic() helper that compares requested_version vs active_version from payload manifest
  • installer/inspection.py: _workspace_bundle_recommendation() now prefers enriched message for GLOBAL_BUNDLE_MISSING
  • runtime/gate_output.py: neutral hint covering both stale stub and genuinely missing bundle scenarios
  • 2 new unit tests for _stale_stub_diagnostic

2. Remove reason_code from user-facing output templates

reason_code is an internal machine verification field. It was leaking into user-facing develop output templates (success/partial/quick-fix) as a raw column.

Changes:

  • All 6 develop output templates (ZH + EN): removed reason_code column
  • Partial templates: added human-readable "说明/Note" column instead
  • output-contract.md (ZH + EN): clarified reason_code is internal-only
  • develop-rules.md (ZH + EN): added one-line constraint in §2.2 supplementary notes
  • Updated 4 golden snapshot hashes

Tests

640 passed, 17 deselected, 31 subtests passed

Stale stub detection:
- bootstrap_workspace.py: add _stale_stub_diagnostic() to distinguish
  stale workspace stub (version mismatch) from truly missing bundle
- inspection.py: workspace-level checks prefer enriched diagnostic
  message; payload-level checks keep generic "refresh payload"
- gate_output.py: neutral hint covering both stale stub and missing
  bundle scenarios
- test_installer.py: 2 unit tests for _stale_stub_diagnostic()

Output template cleanup:
- Remove reason_code column from all 6 develop output templates
  (ZH+EN success/partial/quick-fix). reason_code is an internal
  verification field, not user-facing information.
- output-contract.md: clarify reason_code is internal-only
- Partial template: rename reason_code+root_cause columns to
  human-readable "阻塞原因"/"Block reason" + "根因分类"/"Root cause"
- golden-snapshots.json: update 4 affected hashes
@Li-Sanze Li-Sanze merged commit e8fddc4 into main May 28, 2026
4 checks passed
Li-Sanze added a commit that referenced this pull request May 28, 2026
- blueprint/tasks.md: mark stale stub diagnostics partial done (PR #49), add renderer scope audit backlog
- blueprint/README.md: update latest archive pointer
- sopify.json: bump bundle_version to 2026-05-27.220559
- CHANGELOG, README badges, header templates: version sync
- golden-snapshots.json: updated 6 header + 2 copilot payload hashes
Li-Sanze added a commit that referenced this pull request May 28, 2026
- blueprint/tasks.md: mark stale stub diagnostics partial done (PR #49), add renderer scope audit backlog
- blueprint/README.md: update latest archive pointer
- sopify.json: bump bundle_version to 2026-05-27.220559
- CHANGELOG, README badges, header templates: version sync to 2026-05-28.044501
- golden-snapshots.json: updated 6 header + 2 copilot payload hashes
Li-Sanze added a commit that referenced this pull request May 28, 2026
- blueprint/tasks.md: mark stale stub diagnostics partial done (PR #49), add renderer scope audit backlog
- blueprint/README.md: update latest archive pointer
- sopify.json: bump bundle_version to 2026-05-27.220559
- CHANGELOG, README badges, header templates: version sync to 2026-05-28.044700
- golden-snapshots.json: updated 6 header + 2 copilot payload hashes
Li-Sanze added a commit that referenced this pull request May 28, 2026
- blueprint/tasks.md: mark stale stub diagnostics partial done (PR #49), add renderer scope audit backlog
- blueprint/README.md: update latest archive pointer
- sopify.json: bump bundle_version to 2026-05-27.220559
- CHANGELOG, README badges, header templates: version sync to 2026-05-28.044700
- golden-snapshots.json: updated 6 header + 2 copilot payload hashes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant