🎯 Repository Quality Improvement - Workflow Lifecycle Management & Staleness Detection #6133
Closed
Replies: 2 comments 1 reply
-
|
/plan |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
This discussion was automatically closed because it was created by an agentic workflow more than 3 days ago. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report - Workflow Lifecycle Management & Staleness Detection
Analysis Date: 2025-12-11
Focus Area: Workflow Lifecycle Management & Staleness Detection
Strategy Type: Custom
Custom Area: Yes - This focus area addresses the critical challenge of maintaining workflow compilation consistency across 164+ workflows, detecting stale artifacts, managing lock file synchronization, and guiding users through workflow lifecycle operations.
Executive Summary
Analysis reveals that gh-aw has 46 uncompiled workflows (28% of 164 total) without corresponding
.lock.ymlfiles, indicating significant workflow lifecycle management gaps. While the system implements basic timestamp-based staleness detection in thestatuscommand and supports orphaned lock file cleanup via--purge, there is no proactive guidance for users when lock files become stale, no version tracking in compiled artifacts, and no automated detection of inconsistent compilation states across the repository. The watch mode provides reactive recompilation but lacks integration with CI/CD workflows. Critical improvements needed: (1) lock file metadata versioning system, (2) proactive staleness warnings with actionable guidance, (3) CI workflow to enforce compilation consistency, (4) enhanced status reporting with fix suggestions, and (5) automated bulk synchronization commands.(details)
(summary)Full Analysis Report(/summary)
Focus Area: Workflow Lifecycle Management & Staleness Detection
Rationale for Custom Focus Area
This custom focus area emerged from analyzing the repository's unique challenges:
This focus area is critical for maintaining the reliability and consistency of the agentic workflows system at scale.
Current State Assessment
Metrics Collected:
Key Code Locations:
pkg/cli/status_command.go(523 LOC) - Implements timestamp-based staleness detectionpkg/cli/compile_command.go(1,279 LOC) - Core compilation logic with watch mode and purge supportpkg/cli/dependency_graph.go- Smart recompilation based on workflow imports.github/workflows/*.lock.yml- Contains "DO NOT EDIT" warnings but no version metadataFindings
Strengths
statuscommand implements timestamp-based staleness detection (lines 245-253 of status_command.go)--purgeflag removes lock files without corresponding source workflowsAreas for Improvement
Critical Issues (High Priority)
.lock.ymlcounterparts, creating deployment inconsistencyMedium Priority Issues
gh aw syncorgh aw compile --all --fixfor repository-wide synchronizationLow Priority Issues
Detailed Analysis
1. Lock File Metadata System (Missing)
Current State: Lock files include ASCII art headers and frontmatter comments but no machine-readable metadata for validation.
Impact:
Needed: Structured metadata block with version info, checksums, and timestamps.
2. Staleness Detection Enhancement
Current Implementation (status_command.go:245-253):
Limitations:
touchcommands or filesystem inconsistenciesEnhancement Needed: Content hash comparison, compilation version tracking, and validity checks.
3. Uncompiled Workflows Analysis
46 workflows without lock files:
Root Causes:
.mdfiles without corresponding.lock.ymlImpact:
4. CI/CD Integration Gap
No GitHub Actions workflow enforces compilation consistency.
Needed:
.github/workflows/*.mdhave corresponding.lock.yml5. User Guidance and Actionability
Current UX:
Problems:
gh aw compile my-workflow.mdgh aw compile --fix-allDesired UX:
6. Dependency Graph and Watch Mode
Strengths:
dependency_graph.goGaps:
(/details)
🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: The following tasks are designed for GitHub Copilot agent execution. Please split these into individual work items for Claude to process.
Improvement Tasks
The following code regions and tasks should be processed by the Copilot agent. Each section is marked for easy identification by the planner agent.
Task 1: Implement Lock File Metadata and Hash-based Staleness Detection
Priority: High
Estimated Effort: Large
Focus Area: Workflow Lifecycle Management
Description:
Enhance lock file headers with machine-readable metadata including source content hash, compilation timestamp, gh-aw version, and dependency fingerprints. Update staleness detection in
statuscommand to use content hashes instead of solely relying on timestamps. This enables robust detection of stale lock files even when timestamps are manipulated.Acceptance Criteria:
source_hash,compiled_at,gh_aw_version,dependencies_hashpkg/workflow/compiler.gogenerates metadata during compilationpkg/cli/status_command.goimplements hash-based staleness check as primary method, timestamp as fallbackCode Region:
pkg/workflow/compiler.go,pkg/cli/status_command.go,pkg/workflow/*.goThen update
pkg/cli/status_command.goto:source_hashAdd helper functions in
pkg/workflow/metadata.go:ComputeSourceHash(filepath string) (string, error)ExtractLockFileMetadata(lockFilePath string) (*LockMetadata, error)CompareLockFileToSource(lockFile, sourceFile string) (StaleStatus, error)Ensure all tests in
pkg/cli/status_command_test.goandpkg/workflow/compiler_test.gocover the new hash-based detection.Workflow Steps:
gh aw status --jsonto get compilation statusgh aw compile --all, commit changes, pushEnvironment Variables:
AUTO_FIX_MODE: Set to 'true' to enable auto-compilation and commit (default: false)FAIL_ON_STALE: Set to 'false' to only warn, not fail CI (default: true)Enhance
gh aw statuscommand to support--exit-codeflag that exits with non-zero status if any workflows are uncompiled or stale.Update CONTRIBUTING.md to document the new CI enforcement and recommend running
gh aw compile --allbefore committing.Generate actionable commands based on staleness type:
"Run: gh aw compile (workflow).md""Run: gh aw compile (workflow).md (content changed)""Run: gh aw compile (workflow).md (timestamp mismatch)"""(empty)Add summary footer after table output:
--fix-suggestionsflag that outputs executable shell script:Update tests to verify new output format and ensure actionable commands are correct.
In
CompileWorkflowsfunction:2. Create
pkg/cli/sync_command.go:3. Create
pkg/cli/clean_command.go:4. Add parallel compilation support:
Wire up new commands in
cmd/gh-aw/main.goand add CLI flags. Add comprehensive tests for all three new commands.2. Update
CONTRIBUTING.md:Add section on workflow compilation requirements, pre-commit hook installation, and CI enforcement expectations.
3. Update
DEVGUIDE.md:Add "Workflow Lifecycle Management" section covering best practices, troubleshooting, and bulk operations.
Make these documentation changes and ensure the pre-commit hook is tested with various scenarios.
Beta Was this translation helpful? Give feedback.
All reactions