Files
donlucasandClaude Opus 5 c9a019eb88 The name finally reaches the parts that were left alone
xscapes was decided on 09-01 with the repo, and the rename stopped at the
module path because going further meant touching live state: the env vars,
~/.config/asciiscapes/, and the marker on twelve hooks already installed in
his settings.json. This finishes it.

The marker was the whole risk. It is uninstall's only handle on its own
work, so changing the constant alone would have left twelve hooks that
nothing could see -- uninstall reporting zero, install adding a second copy
beside each, and a person editing JSON by hand to remove a tool that said
it had gone. install.go now WRITES `# xscapes:v1` and RECOGNISES
`# asciiscapes:v1`, and the existing stale-path branch migrates them. The
plan says "migrated from asciiscapes:v1" rather than "re-pointed", because
the two are different amounts of risk and the reviewer should be told which.
Proven by emptying legacyMarkers: the tests go red, and the failure shows
the orphan exactly -- Stop ends up with two hooks, one of them invisible.

Settings were renamed with a fallback rather than a hard cut, because a
rename is the cheapest way there is to build a knob nothing reads: the
value looks applied, the picture does not change, and the measurement is
wrong with nothing saying so. These are variables typed by hand while
judging a frame, so muscle memory is the expected input. internal/envx
keeps ASCIISCAPES_* working and names it on stderr once, from the top of
main -- the last moment certainly safe to write, since -live, claude and
inside take the alternate screen shortly after. hook and statusline are
exempt: one runs on every tool call into /dev/null, the other owns a line
of the agent's chrome. Writing the test for the warning found it firing on
a variable exported empty, which is inert, and a warning that cries wolf on
a clean environment is one nobody reads.

Left saying asciiscapes on purpose, and these are not leftovers: the
legacyMarkers entry, envx's legacyPrefix, the verbatim quotes in
_FEEDBACK.md, origin-chat.md's decision pass, and the superseded bullets in
RESUME.md. Rewriting a record of what was true then would only make it lie.

Live state moved with it: ~/.config/asciiscapes -> ~/.config/xscapes (53
spools, 17 backups), and the twelve hooks migrated with a diff of exactly
24 lines, all marker, nothing else touched. Two spools written into the old
path by the still-old binary during the swap were merged back in timestamp
order rather than appended.

Also drops a duplicated `xscapes tune` line in the help, which predates
this and was only visible once the name was read twice.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1u8vp8AgrTuaCCcLv6HVi
2026-09-03 12:17:14 -07:00

117 lines
5.0 KiB
Go

package main
import (
"fmt"
"strings"
"github.com/donlucasx/xscapes/internal/canvas"
"github.com/donlucasx/xscapes/internal/companion"
"github.com/donlucasx/xscapes/internal/scape"
"github.com/donlucasx/xscapes/internal/term"
)
// facePage is the companion study: how much face a nine-cell head can carry,
// and what the body looks like in something other than cream.
func facePage(seed int64) string {
// A patch of the real scene behind each portrait, because a companion is
// only ever seen against sand and never against a swatch.
portraitPx := func(f companion.Face, coat term.RGB, st companion.State, prof term.Profile, t float64, px int) string {
c := canvas.New(16, 10, canvas.AlphaFar, canvas.AlphaMid, canvas.AlphaNear)
sh := scape.NewShore(seed, false)
for i := 0; i < 12; i++ {
sh.Update(c, 2+float64(i)/20, scape.Activity{Working: true, Level: 0.5})
}
cat := companion.NewCat()
cat.SetFace(f)
cat.SetCoat(coat)
_, chh := cat.Size()
// c.H-2-chh, same as every live surface. The portraits used to sit the
// cat one row lower, which parked the nose row ON the waterline: wave
// glyphs continued the top whisker and two whisker rounds were judged
// against a collision the live scene never has.
cat.Draw(c.Near(), 2, c.H-2-chh, t, st)
return c.HTMLFragmentAs(px, prof)
}
portrait := func(f companion.Face, coat term.RGB, st companion.State, prof term.Profile, t float64) string {
return portraitPx(f, coat, st, prof, t, 15)
}
var b strings.Builder
b.WriteString(`<style>
.win{border:1px solid #2a2a32;border-radius:5px;overflow:hidden}
.row{display:flex;gap:11px;flex-wrap:wrap;align-items:flex-start;margin-bottom:10px}
.col{display:flex;flex-direction:column;gap:4px}
.lbl{font:11px ui-monospace,monospace;color:#8a8a99}
.lbl b{color:#d8d8e0;font-weight:500}
h2{font:600 13px ui-monospace,monospace;color:#d8d8e0;margin:30px 0 4px}
h3{font:500 11px ui-monospace,monospace;color:#8a8a99;letter-spacing:.08em;
text-transform:uppercase;margin:14px 0 6px}
h2+p{margin-top:4px}
</style>`)
b.WriteString(`<h1>xscapes &mdash; whiskers, off the float</h1>`)
b.WriteString(`<p class="nt">The float was real: both pairs hung off the NOSE ROW's fur span, ` +
`but the block under the muzzle is two cells narrower, so the bottom pair reached past it ` +
`into open air. Three fixes to compare, plus the current one for reference. ` +
`<b>tucked</b> anchors the bottom pair to its OWN row, so it grips the narrower block. ` +
`<b>double</b> and <b>double long</b> put both strokes INSIDE the nose block: one ` +
`double-line glyph draws two parallel whiskers in a single cell, so nothing ever reaches ` +
`a row where the head is narrower. A test now walks inward from every whisker cell and ` +
`fails unless it hits fur on its own row &mdash; it goes red on "current" and green on the ` +
`other three. Ear shadows and toes on everywhere. Zoomed row first.</p>`)
cell := func(label, note, body string) {
fmt.Fprintf(&b, `<div class="col"><div class="lbl"><b>%s</b>%s</div><div class="win">%s</div></div>`,
label, note, body)
}
face := func(w companion.WhiskerStyle, toes bool) companion.Face {
return companion.Face{Nose: true, Toes: toes, Whiskers: w, Ears: companion.EarInnerDark}
}
b.WriteString(`<h2>slate, zoomed &mdash; where they sit</h2><div class="row">`)
for _, w := range companion.WhiskerStyles {
cell(w.Name, " &middot; "+w.Note,
portraitPx(face(w.Style, true), companion.Coats["slate"], companion.Working,
term.ProfileTrueColor, 3.1, 30))
}
b.WriteString(`</div>`)
for _, coat := range []string{"slate", "cream", "charcoal"} {
fmt.Fprintf(&b, `<h2>%s</h2><div class="row">`, coat)
for _, w := range companion.WhiskerStyles {
cell(w.Name, " &middot; "+w.Note,
portrait(face(w.Style, true), companion.Coats[coat], companion.Working,
term.ProfileTrueColor, 3.1))
}
b.WriteString(`</div>`)
}
b.WriteString(`<h2>"tucked" across all five coats</h2><div class="row">`)
for _, coat := range companion.CoatOrder {
cell(coat, "", portrait(face(companion.WhiskerTucked, true), companion.Coats[coat],
companion.Working, term.ProfileTrueColor, 3.1))
}
b.WriteString(`</div>`)
b.WriteString(`<h2>The same, as Terminal.app paints it</h2><div class="row">`)
for _, coat := range companion.CoatOrder {
cell(coat, " &middot; 256", portrait(face(companion.WhiskerTucked, true), companion.Coats[coat],
companion.Working, term.Profile256, 3.1))
}
b.WriteString(`</div>`)
b.WriteString(`<h2>Every state &mdash; slate, "tucked"</h2>`)
b.WriteString(`<p class="nt">The whiskers drop a row when something is broken.</p><div class="row">`)
for _, st := range []struct {
s companion.State
n string
}{{companion.Resting, "resting"}, {companion.Working, "working"},
{companion.NeedsYou, "needs you"}, {companion.Done, "done"},
{companion.Worried, "broken"}} {
cell(st.n, "", portrait(face(companion.WhiskerTucked, true), companion.Coats["slate"],
st.s, term.ProfileTrueColor, 3.1))
}
b.WriteString(`</div>`)
return canvas.HTMLPage("xscapes — companion study", b.String())
}