Skip to content

Fix archfit status, App detection for other Apps, request without a tracking ref, and the moved-policy record - #71

Merged
alexei-led merged 10 commits into
mainfrom
fix/status-and-app-detection
Nov 24, 2026
Merged

alexei-led merged 10 commits into
mainfrom
fix/status-and-app-detection

Conversation

@alexei-led

Copy link
Copy Markdown
Contributor

Fixes usability rerun findings N2, N1, N3 and N6. N2 blocks the release, and N1 blocks staging and any App that is not production.

What changes

  • N2, archfit status crash: StatusCmd.Run returned nothing, and kong requires error, so archfit status always exited 2 with return value of func(*main.appDeps) must implement "error". It now returns an error, including a failed write to stdout. A new test walks every kong command, checks by reflection that Run returns exactly error, and runs each command's --help. Running every command for real would push, post or install, so the signature check stands in for that.

  • N1, App detection: setup and status matched the archfit/gate check run by the hard-coded slug archfit-review. The staging App (archfit-review-staging) was never seen. The slug now comes from setup.InstallURL, which a candidate build sets with -X; the default build still reads archfit-review. An install link with no slug trusts no App. The slug reaches the adapters (setupgit.GitHub.AppSlug, a requestsend.StoryText parameter) from the cmd composition root, so the adapters import no application package.

  • N3, archfit request in a --single-branch clone: a branch pushed with -u has no remote-tracking ref, so @{upstream} does not resolve, and the request told the author to push again. It now finds the open pull request by the branch's name on the push remote. The name comes from branch.<b>.merge when its remote is the push remote; otherwise it is the local name. It posts only when that pull request's head is HEAD. Otherwise it sends nothing, names both commits, and prints next: git push <push remote> HEAD:refs/heads/<branch>.

    • When no pull request exists and the branch is not on GitHub (404), the old no-upstream message stays.
    • A can answer without a pull request still opens an issue.
    • The tracked-upstream path is unchanged.
  • N6, wording: a branch whose .archfit.yaml is the file at the merge base, after an owner changed the policy on the target, now gets:

    .archfit.yaml: policy: changed on origin/main since this branch started
      why: the check uses the policy on origin/main
      next: git merge origin/main, then run archfit check again
    

    A branch that edited the file keeps differs from origin/main / only owners change the policy. The JSON cause, differs and kind are unchanged.

  • Docs: commands.md (request), results.md, troubleshooting.md, agents.md (policy records), and ci.md (a candidate build reads its own App's check).

Checks

  • Regression tests fail on d3e33e4 and pass here:
    • TestStatusRunsThroughTheCLI and TestEveryCommandRunReturnsError (N2)
    • the staging rows of TestAppCheckIgnoresOtherApps, TestStoryTextReadsOnlyTheBuildsApp and TestAppSlugComesFromTheInstallURL (N1)
    • TestRequestFindsThePullRequestWithoutATrackingRef (real Git in the single-branch push -u state) and TestUntrackedBranchFindsItsPullRequest (N3)
    • the three "names the merge" cases in changecheck (N6)
  • Story vocabulary (StoryNotUsedIn) runs on the new request errors and policy records.
  • GOWORK=off make all passes (fmt, names, lint 0 issues, race tests, build, archfit: pass), run with GOFLAGS=-timeout=30m because the shared machine is slow. make names is part of it. archfit can cmd/archfit/status.go internal/application/setup answers yes.
  • Review: revmux comprehensive (claude ×3 + codex, 4/4 sources) kept 2 minors, both fixed. revmux final (2/2) kept 2 minors on the push hint, fixed by an explicit refspec. A third final round (2/2) kept 1 minor (a short branch name is ambiguous next to a same-named tag), fixed with HEAD:refs/heads/<branch>.
  • GitNexus: impact rated requestsend.Sender.Send / repository CRITICAL (the whole request path), so the change keeps the tracked path as it was. detect-changes rated the change high risk. That ran against the main checkout's index, 6 commits stale.
  • Not run: language-contracts and tool-locks, because no fixtures, policies, extractors, strength, seams or report changed.

Follow-ups (not changed here)

  • The tracked-upstream path of archfit request still posts when the pull request head is not local HEAD (unpushed commits).
  • The fork push-remote bug from Fix setup after the merge, GitHub failure messages, and onboarding docs #70 is unchanged and not widened: a branch tracking origin/main but pushing to fork/feature looks up fork:main.
  • Pre-existing items the review listed in status: it calls GitHub for every Git checkout; a story from an older pull request head replaces the local verdict; a cached verdict from another commit with the same tree is accepted.
  • Pre-existing in changecheck: the moved-policy record treats an empty file like an absent one.
  • A make-target note: make archfit still accepts exit 2 only for policy: differs from origin/main. A local branch behind an owner's policy change now fails it with the merge advice, by design.

kong requires a Run method to return error and checks it only when it calls
it, so archfit status always exited 2. A test now checks every command's Run
signature and --help.
Setup and status matched the check run by the hard-coded slug archfit-review,
so a build for another App, such as staging, never saw its check. The slug now
comes from setup.InstallURL, which a candidate build sets, and defaults to
archfit-review.
…ng ref

A clone made with --single-branch keeps no remote-tracking ref for a branch
pushed with -u, so @{upstream} does not resolve and archfit request told the
author to push again. It now looks up the pull request by the branch's name on
the push remote and posts only when that pull request's head is HEAD. The
no-upstream answer stays for a branch that is not on GitHub.
After an owner's policy change merges into the target branch, a branch made
before it got "why: only owners change the policy", which reads as if the
author edited the file. When the branch's file is the one at the merge base,
the record now says the policy changed on the target branch and that the check
uses that policy. A branch that edited the file keeps the old record.
Lint flagged repeated literals, the CLI test's complexity and a Run that
always returned nil. The status command now returns a stdout write failure.
…unknown link

Review findings: on the local-name fallback a head mismatch advised git push,
which fails without an upstream; it now advises git push -u <remote> HEAD. An
install link with no App slug fell back to the production App; it now trusts
no App.
Review: choosing between git push and git push -u from the upstream config was
wrong for a renamed upstream and rewrote a fork's pull upstream. On a head
mismatch the next line is now git push <push remote> HEAD:<branch>, which works
whatever upstream Git records and changes no configuration.
Review: a short destination is ambiguous when the remote has a tag of the same
name, so the hint now names refs/heads/<branch>.
@archfit-review

archfit-review Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Archfit: pass

@alexei-led
alexei-led merged commit eb8b0e2 into main Nov 24, 2026
19 checks passed
@alexei-led
alexei-led deleted the fix/status-and-app-detection branch November 24, 2026 14:08
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