Skip to content

[kanon-fake-user] kanon validate/diff/apply should explain when kanon.yaml is missing #101

Open

Description

@kelos-bot

Problem

When a user points Kanon at an initialized-but-incomplete home, the main source and destination commands expose a raw filesystem error instead of explaining how to recover. This is especially easy to hit after moving or deleting kanon.yaml, and it also obscures a wrong --home or KANON_HOME value.

Reproduction on current main

  1. Run kanon --home "$HOME" init in a temporary directory.
  2. Remove that directory's kanon.yaml.
  3. Run kanon validate, kanon diff, or kanon apply --dry-run with the same --home.

Each command exits 1 with only open /tmp/.../kanon.yaml: no such file or directory. The command help and README do not explain that the source config is required or point to kanon init, --home, or KANON_HOME as recovery steps. Related onboarding issue #13 identifies the same raw missing-config error at the shared load site; this issue records the verified impact across the advertised quick-start commands.

Suggested outcome

Wrap the missing-config error with the affected path and a concise recovery hint, for example: Kanon source config .../kanon.yaml is missing; run kanon init or check --home/KANON_HOME. Add CLI coverage for validate, diff, and apply --dry-run so the error remains actionable and names the config file.

Latest verdict

  • Status: VALID
  • Checked at: 2026-10-27T09:00:55Z
  • Evidence: origin/main is still at d588121; rebuilt binary and kanon --home <empty dir> validate still exits 1 with only open <dir>/kanon.yaml: no such file or directory. Related: #13 (closed), #65, PR #68 (open, unmerged).

Activity

  1. kelos-bot commented on Jun 28, 2026

    @kelos-bot
    Author

    🤖 Kelos Task Status

    Task kanon-triage-issues-81844650cd20 has succeeded. ✅

  2. kelos-bot commented on Jun 28, 2026

    @kelos-bot
    Author

    🤖 Kelos Agent @gjkim42

    Kanon Triage Report

    Kind: kind/bug
    Priority: priority/important-soon — User-facing onboarding bug in the advertised second-machine kanon update workflow.
    Actor: actor/kelos — Clear, bounded error-handling change with objectively verifiable CLI output and test coverage.

    Status: STILL VALID

    Evidence:

    • No merged PRs referencing 101 were found with gh pr list --state merged --search "101", and recent git history has no matching 101 or title-keyword fix.
    • Current update still resolves the Kanon home and immediately calls git pull --ff-only without checking whether the source branch tracks an upstream:

      kanon/internal/cli/root.go

      Lines 399 to 411 in ed22fa0

      func updateCommand(opts *options) *cobra.Command {
      cmd := &cobra.Command{
      Use: "update",
      Short: "Pull the source repository, then render and apply (remote to destination)",
      RunE: func(cmd *cobra.Command, _ []string) error {
      home, err := opts.resolvedHome()
      if err != nil {
      return err
      }
      if err := core.RunGit(home, cmd.OutOrStdout(), cmd.ErrOrStderr(), "pull", "--ff-only"); err != nil {
      return err
      }
      return opts.runApply(cmd, !opts.yes)
    • core.RunGit only streams git stderr and wraps failures as git [pull --ff-only]: <error>, so the raw missing-upstream git output remains the user-visible failure path:
      func RunGit(home string, stdout, stderr io.Writer, args ...string) error {
      cmdArgs := append([]string{"-C", home}, args...)
      cmd := exec.Command("git", cmdArgs...)
      cmd.Stdout = stdout
      cmd.Stderr = stderr
      if err := cmd.Run(); err != nil {
      return fmt.Errorf("git %v: %w", args, err)
      }
      return nil
      }
    • The referenced command and behavior are current: README still describes kanon update as pull plus apply for another machine.

    Duplicates found: None found

    Recommendation: KEEP OPEN

  3. changed the title [-]kanon update should explain when the source home is not linked to a git remote[/-] [+]kanon diff/apply should explain when kanon.yaml is missing[/+] on Jul 17, 2026
  4. changed the title [-]kanon diff/apply should explain when kanon.yaml is missing[/-] [+]kanon validate/diff/apply should explain when kanon.yaml is missing[/+] on Aug 2, 2026
  5. changed the title [-]kanon validate/diff/apply should explain when kanon.yaml is missing[/-] [+][kanon-fake-user] kanon validate/diff/apply should explain when kanon.yaml is missing[/+] on Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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