Skip to content

fix: add before/after logging for all state-mutating operations #26

@tsavo-at-pieces

Description

@tsavo-at-pieces

Summary

Comprehensive audit found 8 silent mutations and 6 missing-BEFORE-state operations across the CLI commands.

Critical Silent Mutations (no logging at all)

Location Operation
create_release_command.dart:238-265 git config + git add (verbose-only)
manage_cicd.dart:2019-2039 git config + git add (verbose-only)
act.dart:101-105 Game plan JSON writes
consumers_command.dart:1214-1224 _atomicWriteJson
step_summary.dart:12 GitHub Step Summary appends
template_manifest.dart:96 Template version tracker save
version_detection.dart:148,163 Gemini response JSON writes
sub_package_utils.dart:278,369 Sub-package pubspec mutations

Missing BEFORE State

Location Operation
create_release_command.dart:117 pubspec version bump (no old→new)
update_command.dart:219-256 Template file copies (no diff)
audit_command.dart:126 pubspec fixes (no before state)
compose_command.dart:116 CHANGELOG write
autodoc_command.dart:59-62 Legacy migration
init_command.dart:242-249 .gitignore append

Pattern to Follow

Every mutation should:

  1. Before: Log intent + current state
  2. Execute: Do the thing
  3. After: Log success/failure + what changed

Fix Plan

  • Add logging wrappers for git operations in release commands
  • Add before/after logging for act.dart game plan writes
  • Log old→new version in pubspec bumps
  • Log file diffs or summaries for template updates
  • Ensure _atomicWriteJson logs its operations
  • Add logging for all writeAsStringSync calls in release pipeline

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions