Skip to content

Close out the v0.4.0 list/show review follow-ups - #7

Merged
usmanbashir merged 14 commits into
mainfrom
t3/fix-issue-2-accounting-and-tests
Oct 27, 2026
Merged

usmanbashir merged 14 commits into
mainfrom
t3/fix-issue-2-accounting-and-tests

Conversation

@usmanbashir

Copy link
Copy Markdown
Owner

Closes #2

All four behavior edges and all eight test-tightening items from the issue, one commit each.

Behavior

  • clau list link accounting (row badges and footer) now enumerates the global token set that clau link creates and prunes, instead of the effective ladder filtered by it. Under a project [efforts] replacement the model row no longer warns forever about commands link never creates, and a deleted global command (say co5) is noticed inside the project too: the footer says 23 of 24 in both places. Project-only digit tokens stay in the footer count and in clau show.
  • clau show <letter><digit> reports source project whenever the project file declares a non-empty [efforts], since that replaces the whole ladder. projectDeclarations now reports the flag.
  • contractHome compares the raw strings first, then both sides through EvalSymlinks, so a home reached via a different symlinked path still contracts to ~. A path that does not exist yet keeps the raw comparison.
  • stdoutIsTTY keeps the char-device heuristic on purpose; a comment says so rather than adding a golang.org/x/term dependency for an effect nobody can observe.

Tests

  • TestContractHome covers p == home, and a new symlinked-alias test runs in both directions (skipped on Windows).
  • TestRowBadges covers all eight combinations, including the orphaned-link ones.
  • TestFamilyStates exercises a letter without effort digits, asserts orphaned links as linked-but-unlinkable, and covers the project-ladder cases.
  • The plain profile kind row, the plural KEYS/SECRETS/PASSWORDS and mid-name TOKEN_EXPIRY env names, and the exact linked no — run clau link hint in TestShowViewProfile are asserted. The issue filed that last one under TestShowViewProjectSourceAndLinked, which already asserts the project-shortcut branch.
  • Completions tests check show sits in each shell's verb list and in its run/show token-completion branch.
  • digitSpan notes its reliance on the single-digit keys effortKeyRe enforces.

Manually verified with an isolated HOME: a digit-6 project with everything linked shows no row badges and all 24 commands linked · 4 project-only; after rm co5 the o row warns and the footer says 23 of 24 inside the project, with a 1/2 ladder, and outside it; a project model letter g shows project · c g and 6 project-only.

familyStates built a letter's family from the effective ladder, and
footerLine counted only effective tokens, while clau link is global-only.
Under a project [efforts] replacement that warned forever about digit
commands link never creates and dropped the global ones it prunes from
the denominator (a deleted co5 went unnoticed inside the project). Both
now enumerate the global set; project-only tokens stay in the footer
count and in clau show.
tokenSource stripped the digit and checked only the project's model
letters and profiles, so inside a project whose [efforts] is only 6,
clau show o6 said source global. A non-empty project [efforts]
replaces the whole ladder, so projectDeclarations now reports it and
every digit token counts as project-sourced while it is in effect.
contractHome compared raw strings only, so a home reached through a
different symlinked path (or a link dir under one) never contracted.
Compare the raw strings first, then both sides through EvalSymlinks;
a path that does not exist yet keeps the raw comparison.
@usmanbashir
usmanbashir marked this pull request as ready for review October 27, 2026 15:20
@usmanbashir
usmanbashir marked this pull request as draft October 27, 2026 15:20
@usmanbashir
usmanbashir marked this pull request as ready for review October 27, 2026 15:22
tokenSource applied the digit rules to every token, so a global profile
whose name ends in a digit (qwen3, v2) was labeled project-sourced in a
project with its own [efforts], and one shaped like a project letter's
grammar (g3 under a project declaring g) was already mislabeled on main.
Profiles beat the grammar in resolveToken, so a profile the project
does not declare is global; check that before the letter and digit
rules. tokenSource is now a viewContext method, which is what it reads.
contractHome resolved the whole path, so through an aliased home the
linked row of clau show followed the co5 link to the clau binary and
printed ~/bin/clau, or the full raw path when the binary sits outside
home. Resolve the parent directory only and keep the leaf as named.
familyStates matched letter+digit names against the global token set,
which includes profile names, so a profile such as o7 was counted as
one of opus's commands and a missing co7 warned on the model row as
well as the profile row. A profile wins resolution, so its command is
the profile row's alone; skip profile names when building the family.
This also stops the older double warning for a profile that shadows a
ladder digit, such as o5.
@usmanbashir
usmanbashir merged commit 39731b1 into main Oct 27, 2026
4 checks passed
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.

Post-v0.4.0 polish: review follow-ups from the list/show redesign

1 participant