@bitefoundry/retrieviewer 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,17 @@ of exclusive ownership of AI output.
6
6
 
7
7
  ## Evidence checked
8
8
 
9
+ - Unreleased comfort v6 adds a front-facing carry-trot study generated using
10
+ built-in imagegen with only the existing approach and arrival-seat puppy as
11
+ references. No new photograph/video input. Eight whole-pose keys (four unique
12
+ trot phases, four gathering steps) are appended; accepted v5's37 frames remain
13
+ pixel-exact. One common scale, whole-image floor translation, per-key measured
14
+ mouth/support anchors, no anatomical compositing. Last gathering key is exact
15
+ arrival-seat source0. Full prompt/source hash and size evidence live in
16
+ dist/carry-trot-v1/NOTES.md and puppy-companion-comfort.json. Existing artwork
17
+ attribution and CC BY-SA4.0 remain. The owner subsequently requested publishing
18
+ the reviewed candidate with the original braking return preserved as an option.
19
+
9
20
  - PUPPY-STUDY.md identifies the initial built-in image-generation output and
10
21
  the two photographic inputs. The generated source and both local reference
11
22
  images were visually inspected. Their stored Commons metadata was checked
@@ -35,6 +46,31 @@ must be checked again for the final release bytes.
35
46
 
36
47
  ## Remaining limits
37
48
 
49
+ Unreleased0.0.10 replaces the36 watch samples with an owner-approved whole-body
50
+ redraw (head, neck, shoulders and foreleg weight transfer together). Built-in
51
+ imagegen referenced only the existing approved puppy and its generated study,
52
+ not new photographs. One common uniform scale and whole-frame floor translation
53
+ replace the earlier row-dependent warps; no anatomical masks or body compositing.
54
+ WATCH-REDRAW.md and the manifest retain preparation/source digests. Other behavior
55
+ frames remain byte-identical. Existing CC BY-SA4.0 attribution remains in place.
56
+ The owner then approved the new momentum-pose studies on2026-10-23 and requested
57
+ implementation. The working tree now includes a v5 comfort family: the original13
58
+ tug/sleep frames remain byte-exact,12 standing pickup keys are retained, and12
59
+ rear stumble samples replace the rejected lateral choreography. Four samples
60
+ are registered directly from the approved rear-quarter study; the others use a
61
+ built-in imagegen breakdown sheet referenced only from that approved art and the
62
+ existing puppy. Exact existing run/rear pickup endpoints remain shared. Uniform
63
+ batch scales and whole-frame translations only, no anatomical compositing or live
64
+ image deformation. Source digests, timings and transforms are in the comfort
65
+ metadata; prompts/raw originals remain local, outside npm. Visual acceptance of
66
+ the completed animation was followed by the owner's explicit publication request.
67
+
68
+ 0.0.9 adds offline torso-envelope constraints to the same single-source watch
69
+ coordinate field, using only the existing seated key as a volume reference.
70
+ Face pixels remain exact; the connected neck/body is spatially registered, not
71
+ composited with another illustration. No new visual input or asset family;
72
+ existing CC BY-SA4.0 attribution and licenses remain.
73
+
38
74
  0.0.8 replaces the watch-body joins with offline coordinate registration of
39
75
  the same single source drawing per sample. Four paw patches and a shared ground
40
76
  plane constrain the lower-body warp; original head/neck pixels remain exact.
package/PUPPY-MEMORY.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # Runtime weight and performance
2
2
 
3
+ ## Spatial autonomy and allocation pass (0.0.10)
4
+
5
+ Autonomous strolls, dashes and butterfly visits no longer end with an unconditional
6
+ trip to the front-center home. Only an occasional check-in or ball return comes
7
+ back there. Check-ins have a 90-second spacing; lingering front and center for
8
+ 40 active seconds prompts a later outing, after the current episode finishes.
9
+ Outings alternate sides and near/middle/far depths, up to 15m behind the world
10
+ origin. Sideways room is calculated from the existing camera frustum, not a fixed
11
+ narrow x corridor. Naps/rests find side nooks 0.7–2.6m behind the origin and often
12
+ stay in a suitable nook already found. All travel still uses the same integrated
13
+ gait and projection; there is no scale animation, teleport or extra dog artwork.
14
+
15
+ Ten seeded 20-minute simulations spent 7–27% of time in the front-center zone,
16
+ used both sides and multiple sleeping spots, and preserved stationary nap roots.
17
+ Tests also cover uninterrupted gait travel, fetching home from a distant nap,
18
+ and hand-fed treats without a detour. These are design parameters, not claims
19
+ about measured canine behavior. The rare butterfly's lateral bounds now follow
20
+ its current depth too, so a side-positioned puppy faces the visitor correctly.
21
+
22
+ Memory changes reuse existing code and built-in Node compression:
23
+
24
+ - Stable Braille output joins one reusable row of glyph references instead of
25
+ creating one string rope node per cell. Exact text and dot thresholds unchanged.
26
+ - Minification integral tables allocate on first use, with uint32 sums for byte
27
+ art. Even the largest 640² source sum fits exactly; fractional custom images
28
+ retain Float64 tables. Fractional footprint arithmetic stays unchanged.
29
+ - Node's retained crop compression uses DEFLATE level3 instead of level1.
30
+ Levels6/9 were rejected for 3.3s/21.5s crop-processing startup in the local probe.
31
+ Level3 cuts retained crop payload from22,222,718 to20,517,500 bytes, at about
32
+ half a second extra startup. Browser art storage and files stay unchanged.
33
+
34
+ Three fresh Windows processes per side, same 450-frame 480×135 ball sequence;
35
+ medians measured **before changing autonomy**, to isolate the memory work:
36
+
37
+ | Metric | Before | After |
38
+ | --- | ---: | ---: |
39
+ | Initial load | 916ms | 1,419ms |
40
+ | Loaded process RSS | 99.7MiB | 97.4MiB |
41
+ | Rendered ArrayBuffers after diagnostic GC | 29.0MiB | 26.1MiB |
42
+ | Rendered process RSS after diagnostic GC | 237.6MiB | 167.8MiB |
43
+ | Peak benchmark-process RSS | 250.5MiB | 191.0MiB |
44
+ | Mean frame time | 3.53ms | 3.59ms |
45
+ | Frame time p95 | 6.35ms | 6.72ms |
46
+
47
+ All six frame hashes equal
48
+ `3a296d0a737eaa1d9a5923e3496e8c62b2d5e99fbe871806b907429515597a3d`.
49
+ This synchronous off-screen workload is **not the resident desktop RAM figure**:
50
+ GC, deferred native-close callbacks and allocator retention affect RSS. A short
51
+ owned-window native run of the combined changes measured105MiB Node RSS; helper
52
+ memory is separate. It verified painting, ball IPC and clean worker/helper exit,
53
+ without restarting the user's pet. No real Mac/Linux RAM measurement this pass.
54
+ Proof files are local `dist/roam-memory-{before,after}*.json` and
55
+ `dist/windows-overlay-qa/lifecycle-receipt.json`. No new dependency, process,
56
+ timer, art frame, reduction in resolution, palette change or package art bytes.
57
+
58
+ ## Fixed-volume watch torso (0.0.9)
59
+
60
+ Paw registration alone in0.0.8 left the upper torso unconstrained. In the36
61
+ watch samples, chest-region (source rows205..230, ink threshold>24) area/mean
62
+ silhouette width grew up to28.9% compared with the seated key. Offline torso
63
+ envelope calibration brings both below1.2%, with centroid movement below0.52
64
+ source pixels. Regression limits are2% chest area/width,1px centroid,3% whole
65
+ torso area (rows205..270), plus the existing four-paw and common-floor tests.
66
+
67
+ The same single-source inverse coordinate field now eases from y180 to205,
68
+ matches the seated torso envelope through y265 and joins the paw field by y275.
69
+ Only the silhouette calibration curves are smoothed, not fur pixels. Face rows
70
+ 0..179 remain byte-exact; the connected neck/bandana can move spatially to join
71
+ the stable chest, instead of freezing the inflated source torso or compositing
72
+ two pictures. The previous y230 pixel digest is superseded deliberately by a
73
+ face-only digest plus explicit body-volume tests. No new frames, runtime work,
74
+ buffer, dependency or process. The archive is3,118 bytes smaller than0.0.8.
75
+ Earlier release sections below are historical, not current registration rules.
76
+
3
77
  ## Single-source watch registration and English desktop UI (0.0.8)
4
78
 
5
79
  The0.0.7 neck fix still joined a different torso to the lower legs. This pass
package/README.ko.md CHANGED
@@ -38,6 +38,13 @@ Node.js/npm이 없다면 [먼저 설치](PREREQUISITES.md)해 주세요.
38
38
  `retrieviewer desktop --ink dark`를 쓰세요. 실행 중이라면 먼저 종료하고 다시
39
39
  실행하세요. 배경을 캡처하지 않고, 같은 도트에 색만 바꿉니다.
40
40
 
41
+ 0.0.10부터 `--return-style auto|brake|trot|run-trot`로 귀환도
42
+ 고를 수 있어요. 기본 `auto`는 기존 제동·총총·달리다 총총을 섞고 같은 동작이
43
+ 연달아 나오지 않게 합니다. 기존 제동만 쓰려면
44
+ `retrieviewer desktop --return-style brake`. 실행 중인 강아지는 직접 종료한 뒤
45
+ 다시 실행하세요. import해서 쓸 때는 `createPet({returnStyle:'auto'})` 또는
46
+ `pet.setReturnStyle('brake')`로 고릅니다. 바꾸면 다음 공놀이부터 적용돼요.
47
+
41
48
  > **Cursor / VS Code Remote SSH 사용자:** 원격 서버의 터미널이 아닌,
42
49
  > Cursor 화면이 떠 있는 **로컬 PC의 PowerShell/터미널**에 설치하세요.
43
50
  > 서버의 `DISPLAY=:1`은 서버 쪽 X11 화면을 뜻합니다. VNC로 그 화면을 보고
package/README.md CHANGED
@@ -45,6 +45,13 @@ Choose the dot color at launch: `retrieviewer desktop --ink gold`, or
45
45
  `retrieviewer desktop --ink dark` for light backgrounds. Default: `cream`.
46
46
  Quit a running companion first. Colors reuse the same artwork; no screen capture.
47
47
 
48
+ Version 0.0.10 offers `--return-style auto|brake|trot|run-trot`.
49
+ `auto` mixes the original braking return, a trot and run-then-trot, without
50
+ adjacent repeats. For example, `retrieviewer desktop --return-style brake` keeps
51
+ the original return. Quit and relaunch to change the desktop choice; an existing
52
+ companion is not restarted for you. Embedders can use `createPet({returnStyle:'auto'})`
53
+ and `pet.setReturnStyle('brake')`; changes apply to the next throw, not mid-fetch.
54
+
48
55
  > **Cursor / VS Code Remote SSH:** run those commands in your **local** computer's
49
56
  > terminal, not the remote server's terminal. The puppy belongs where the window
50
57
  > is displayed. A server's `DISPLAY=:1` refers to that server's X11 display, which
package/RELEASING.md CHANGED
@@ -1,14 +1,35 @@
1
- # Retrieviewer 0.0.8 release process
2
-
3
- Current target: `@bitefoundry/retrieviewer@0.0.8`, public `latest`, continuing the
4
- approved npm release workflow. The owner requested a quick leg/body alignment
5
- repair and English desktop messages on2026-10-23. Watch preparation now registers
6
- four paws using one source drawing and a smooth coordinate field; no separate
7
- torso/legs are composited. Head/jaw/neck pixels remain untouched. Windows/macOS
8
- picker, toolbar, menu and status copy is English (Linux already was English),
9
- with wider buttons. No new frames, runtime dependencies or live warp buffers.
10
- MIT/CC BY-SA4.0 unchanged. Preserve0.0.7 and earlier registry bytes; publish only
11
- the exact tested0.0.8 tarball. Historical scope below is not current verification.
1
+ # Retrieviewer 0.0.10 release process
2
+
3
+ The owner explicitly requested publication and website deployment after reviewing
4
+ the repaired watch/fetch motion and restoring the original braking return as an
5
+ option. The publication gate is approved for this0.0.10 scope. The earlier hold
6
+ and old local candidate tarballs are superseded; build and verify a fresh exact
7
+ artifact before upload. This authorization does not cover rejected art/motion.
8
+
9
+ Current target: `@bitefoundry/retrieviewer@0.0.10`, public `latest`. The owner
10
+ explicitly requested npm publication and website deployment on2026-10-23.
11
+ Spatial autonomy no longer returns home after every outing; napping uses side
12
+ nooks, with occasional check-ins and ball returns kept. Existing calibrated
13
+ travel, English desktop UI and MIT/CC BY-SA4.0 licenses remain. Allocation
14
+ work uses flat Braille row joins, exact lazy integer minification tables and
15
+ Node DEFLATE level3. See PUPPY-MEMORY.md for measured memory/startup tradeoffs.
16
+ Watch art replaces36 frames. The stationary six-key stumble and v4 lateral
17
+ overshoot/reChase choreography were rejected. The37-key v5 comfort family is now
18
+ integrated (original13 +12 standing pickup +12 rear stumble); source/preparation
19
+ records are in dist/stumble-runtime-v3. Its entry-speed/stride/catch physics end
20
+ at the ball on one depth pursuit. No lateral detour or extra recovery hop. The
21
+ same default assets now include eight added carry-trot/gather keys (45-key comfort
22
+ family) with exact old37-frame preservation. Impact timing is .65s. Fetch returns
23
+ retain the original braking approach alongside trot and run-then-trot. The new
24
+ `returnStyle` option selects auto or one fixed style; auto mixes all three without
25
+ adjacent repeats. `setReturnStyle()` applies to the next throw. Desktop accepts
26
+ `--return-style`, reports its choice, and never restarts a running companion to
27
+ change it. No new artwork or extra raster buffer for restoring the old option.
28
+ Four style-specific seeded replays and fresh native checks pass; see
29
+ WATCH-REDRAW.md for current verification and additional pixel payloads.
30
+ No new runtime dependencies, processes or timers. Preserve0.0.9 and
31
+ earlier registry bytes; publish only the exact tested0.0.10 tarball.
32
+ Historical scope below is not current verification.
12
33
 
13
34
  Target: `@bitefoundry/retrieviewer@0.0.4`, public npm registry, `latest` tag.
14
35
  The npm organization `bitefoundry` uses the free public-packages plan; account
@@ -0,0 +1,175 @@
1
+ # Watch/fetch artwork review for0.0.10
2
+
3
+ The owner accepted the second whole-body watch candidate and new momentum
4
+ drawings, then reviewed v6 and requested retaining the original braking return
5
+ alongside the new trot choices. The subsequent explicit request to publish and
6
+ update the website authorizes this0.0.10 candidate. Earlier holds and rejected
7
+ motion candidates below are historical, not the current publication policy.
8
+
9
+ ## Watch candidates
10
+
11
+ The0.0.9 row-dependent torso-envelope warp can satisfy width/area/paw tests while
12
+ still looking lens-distorted. Numerical bounds are not a human visual approval.
13
+ A first redraw experiment used a fixed torso and an authored head/neck layer;
14
+ the owner rejected the disconnected upper/lower motion. Do not publish that rig.
15
+
16
+ The second candidate uses newly authored **whole-body** keys. Head yaw is coupled
17
+ to shoulder/chest/foreleg weight transfer in the drawing. Preparation applies one
18
+ common uniform scale and whole-frame floor translation. No collar matte,
19
+ anatomical masks, per-row scaling, optical flow or runtime body deformation.
20
+ The owner accepted this candidate after rejecting the disconnected first study.
21
+ Existing seated endpoints are exact; the same36 logical watch frames replace the
22
+ old ones. Whole adjacent pose keys are sampled at the existing cadence.
23
+
24
+ Built-in imagegen inputs were the existing approved seated puppy and the first
25
+ generated study, never a newly downloaded photo. The final prompt asked for a
26
+ 5×3 grid of15 full-body yaw keys, a fixed camera and body mass, a connected neck
27
+ and shoulders, planted paws and subtle foreleg weight transfer. Source and full
28
+ preparation records remain locally in `dist/watch-redraw-v2/`; the source PNG's
29
+ SHA-256 is in its candidate.json. The first draft is retained separately for
30
+ comparison, not composited into the second candidate.
31
+
32
+ ## Current fetch motion: brisk single pursuit and carry-trot
33
+
34
+ The owner found v5 more natural but asked for a more dynamic impact and a small
35
+ trotting return instead of repeated braking. V6 preserves every one of its37
36
+ art samples. Impact timing changes from .82s to .65s: fore-brace .19s, residual
37
+ catch .29s, recovery .17s. The physical entry solver uses the same new durations
38
+ and residual-speed ratio .24; the source extremes are not spatially warped.
39
+
40
+ Eight added keys provide four distinct diagonal trotting phases and four small
41
+ gathering poses. Repeated source-study poses are omitted. The final key is the
42
+ exact existing arrival-seat frame0, not a new approximation of the sit handoff.
43
+ Gait phase uses traveled distance / fitted trot stride; cadence never exceeds
44
+ the calibrated trot frequency. Visible forepaw support proxies use the existing
45
+ ground lock and separate swing/support strips. The head/body are not warped.
46
+ Mouth anchors are per-key in the same registered source coordinates.
47
+
48
+ The owner requested retaining the old braking return as a selectable alternative,
49
+ not replacing it. An independent return-choice stream now mixes brake, trot and
50
+ run-then-trot without adjacent repeats. `returnStyle` fixes one style or selects
51
+ auto; the public setter affects the next throw only. Desktop startup accepts
52
+ `--return-style`; an already-running companion is not silently restarted or
53
+ changed. It does not consume the fetch-pattern or ordinary autonomy RNG. The two
54
+ new return types use small gathering steps: the last gathering keys move through at
55
+ most8.8cm and finish at zero velocity before the shared sitting source. Existing
56
+ non-fetch approaches are unchanged. Source/prompt: `dist/carry-trot-v1/NOTES.md`;
57
+ preparation: `tools/prepare-carry-trot.*`, from the hash-checked v5 stage. Raw study
58
+ is not shipped. Additional gzip81,084bytes; portable retained pixel increment
59
+ 259,057bytes versus v5; Node retained compressed pixels +90,697bytes in the same
60
+ default-loader comparison. These are pixel payloads, not a promise about RSS.
61
+
62
+ `puppy-carry-trot.test.mjs` covers distance/speed continuity, short and200m paths,
63
+ cyclic support/phase, controller return variety, exact sit handoff, mouth anchor,
64
+ old37-frame digest, bounded retention and disposal. Full suite:167 passed, two
65
+ live-macOS checks skipped on Windows, zero failures. Native Windows owned-window
66
+ overlay check passed and both owned worker/painter processes exited. Aside
67
+ screenshots checked impact and new carry poses. The owner subsequently requested
68
+ publication; numerical tests alone did not supply that authorization.
69
+
70
+ ### Preserved v5 basis
71
+
72
+ The owner rejected v4's lateral routing even after timing improved: it still
73
+ made a shallow detour, ran sideways, overshot the ball, reversed, and chased again.
74
+ Do not reinstate that choreography or its rejected side-on stumble art.
75
+
76
+ The v5 comfort family now replaces only the new stumble portion. It preserves
77
+ the13 original tug/sleep frames and12 standing pickup frames exactly. Twelve
78
+ rear stumble samples include four direct registrations from the owner's approved
79
+ rear-quarter original study; intermediate poses were generated with built-in
80
+ imagegen using those originals and existing rear endpoints only. The first/last
81
+ keys are exact existing run/rear-stand sources. One common scale per authored
82
+ batch, whole-frame registration, no body compositing or nonlinear warp.
83
+
84
+ `planPaperStumble` solves entry arc length, speed and stride together. The dog
85
+ enters the authored contact phase with positive velocity, brakes to a residual
86
+ speed, then decelerates to rest through its catch step at the pickup root. No
87
+ stop/relaunch between bracing and catching. The single depth pursuit never uses
88
+ an x-axis showcase detour or second reChase. The dog picks up facing away before
89
+ its normal unarmed return. Camera/projection and other fetch patterns are retained.
90
+
91
+ Source and exact generation prompt: `dist/stumble-runtime-v3/NOTES.md`.
92
+ Runtime metadata carries source hashes and transforms. The generator pins the
93
+ unmodified comfort prefix to commit9fc9628 so --apply remains reproducible after
94
+ integration. `node tools/check-fetch.mjs --default` verifies actual default assets
95
+ and all four seeded patterns; `puppy-stumble-path.test.mjs` freezes original13-key
96
+ pixels, shared endpoints, byte budgets, velocity/phase/arrival and no detour.
97
+
98
+ Measured additions over the original13-key family: gzip246,820bytes, portable
99
+ retained pixels702,249bytes, Node compressed pixels277,204bytes. No additional
100
+ runtime dependency/process/timer or raster buffer; these are not desktop RSS.
101
+ This does not substitute numerical tests for the owner's animation review.
102
+
103
+ ## Superseded fetch candidates (history, not current motion)
104
+
105
+ Clean fetch, rolling chase, a missed landing followed by re-chase, and a rare
106
+ shallow-side overrun use separate seeded choices with no immediate repetition.
107
+ The tumble is asset-gated and separated by at least four throws. Ball ground
108
+ travel reuses the existing analytic travel planner with constant deceleration;
109
+ stripe rotation follows traveled distance / radius. A dropped ball rolls a short
110
+ distance before settling. Accepted interactions retain the prompt chase response.
111
+
112
+ The owner rejected the first fetch timing replay as sluggish. Urgent preparation
113
+ now covers each fetch leg and pickup/drop facing/sitting, not just the initial
114
+ launch. A deferred belly/trick finishes its recovery at the urgent cadence. Root
115
+ travel, physical speed and distance-driven strides are unchanged; urgency resets
116
+ at idle so ordinary watching does not inherit fast timing. Pickup/drop source
117
+ clips take0.65s each. The updated four-pattern replay remains under visual review.
118
+
119
+ The stationary six-key stumble candidate in `dist/scramble-art-v1/` was rejected
120
+ as awkward and is excluded from the current preview. The owner also rejected
121
+ turning front/seated before picking up a ball that was reached facing away.
122
+
123
+ The new **staged v4** candidate is in `dist/fetch-art-v2/`. It has12 authored
124
+ whole-body stumble breakdowns and6 keys each for standing rear/side pickups,
125
+ plus the original13 tug/sleep frames preserved byte-exact. The first stumble
126
+ key is EXACTLY the old run pair5/blend0 forepaw-contact frame; the last is the
127
+ old standing frame. Runtime hands off at that actual stride phase while speed
128
+ is positive, carrying the same root velocity into analytic braking. The existing
129
+ camera never turns. A short recovery bound advances6cm and rises2.5cm in world
130
+ space; the same pinhole projection handles its height/depth/scale. There is no
131
+ stationary idle/settle between running and stumbling. The direction/flip remains
132
+ unchanged through the impact and recovery.
133
+
134
+ Rear and side pickups keep their approach heading and standing root, lower the
135
+ connected head/neck/shoulders, and only turn AFTER pickup. The root stops17cm
136
+ short of the ball rather than over it. The rear muzzle/ball is occluded behind
137
+ the body; the visible side pickup uses authored mouth locations, not screen-center
138
+ coordinates. Legacy clips remain a fallback when optional new art is absent.
139
+
140
+ Key poses and momentum/spacing/overlap were chosen before breakdowns, following
141
+ [Microsoft's character-animation principles](https://learn.microsoft.com/en-us/windows/win32/lwef/animation-principles)
142
+ and the [Blender keyframe/breakdown distinction](https://docs.blender.org/manual/en/2.90/animation/keyframes/introduction.html).
143
+ This is not a claim that extra pictures or mathematical checks guarantee appealing
144
+ motion. The complete replay still needs the owner's visual acceptance.
145
+
146
+ The built-in imagegen inputs were only existing approved run/standing/rear frames,
147
+ not new photos/video. Exact prompt text, source PNGs, registered keys and candidate
148
+ metadata remain in `dist/fetch-art-v2/`. No optical flow/model/runtime warp,
149
+ expanded tween film, extra raster scratch, archive family, dependency, timer or
150
+ process. Relative to the current13-frame family, measured additions are252,774
151
+ gzip bytes,766,040 portable retained pixel bytes and286,718 Node compressed crop
152
+ bytes. These are NOT measurements of whole-desktop RSS. See
153
+ `dist/fetch-qa/receipt.json` for the actual-engine four-pattern verification.
154
+
155
+ Terms for accepted
156
+ derivatives remain CC BY-SA4.0 with the existing attribution chain; generated
157
+ source sheets are not included in npm. Update provenance and integration tests
158
+ after accepting candidates; the pending package tarball is obsolete.
159
+
160
+ ## Local review
161
+
162
+ - `node tools/prepare-watch-redraw.mjs` writes a candidate, not shipped assets.
163
+ - `node tools/check-watch-redraw.mjs` makes a same-state old/new text replay.
164
+ - `node tools/prepare-scramble-art.mjs` writes a candidate, not shipped assets.
165
+ - `node tools/prepare-fetch-art.mjs` prepares the current pose-first candidate.
166
+ - `node tools/prepare-stumble-v3.mjs --apply` builds/integrates the current v5
167
+ momentum family; old v4 tooling/material above is historical.
168
+ - `node tools/check-fetch.mjs` collects four real seeded fetches, without a
169
+ runtime pattern-forcing/debug API.
170
+ - `node tools/preview-site.mjs` serves the existing site-dist locally. Review
171
+ watch-redraw-preview.html and
172
+ fetch-preview.html?data=fetch-preview.json&pattern=tumble.
173
+
174
+ The local replay uses plain text frames; it does not run another pet core in the
175
+ browser. Native live user windows and the already installed pet remain untouched.
package/braille.mjs CHANGED
@@ -31,8 +31,10 @@ function stableBraille(rgba,width,height,brightness,contrast){
31
31
  n=Math.imul(n^(n>>>16),0x45d9f3b);n=Math.imul(n^(n>>>16),0x45d9f3b);n=(n^(n>>>16))>>>0;
32
32
  if(value>(n+.5)/4294967296){masks[(y>>2)*columns+(x>>1)]|=BRAILLE_BITS[y&3][x&1];dots++;}
33
33
  }
34
- const lines=[];
35
- for(let y=0;y<rows;y++){let line='';for(let x=0;x<columns;x++)line+=GLYPHS[masks[y*columns+x]];lines.push(line);}
34
+ // Reuse one row of glyph references. Per-cell string concatenation retained
35
+ // thousands of rope nodes until the final join on large desktop grids.
36
+ const lines=new Array(rows),cells=new Array(columns);
37
+ for(let y=0;y<rows;y++){for(let x=0;x<columns;x++)cells[x]=GLYPHS[masks[y*columns+x]];lines[y]=cells.join('');}
36
38
  return{text:lines.join('\n'),columns,rows,dots};
37
39
  }
38
40
  export function rgbaToBraille(rgba,width,height,{brightness=1,contrast=1,method='floyd'}={}){
@@ -94,13 +94,14 @@ export async function desktopHelper(options={}){
94
94
  }
95
95
  export async function startDesktop(options={}){
96
96
  const ink=options.ink??'cream';if(!['cream','gold','dark'].includes(ink))throw Error('Invalid desktop ink');
97
+ const returnStyle=options.returnStyle??'auto';if(!['auto','brake','trot','run-trot'].includes(returnStyle))throw Error('Invalid return style');
97
98
  // Fail before creating any cache/session on unsupported desktops (e.g. Wayland).
98
99
  desktopPlatform(options);
99
- const status=await desktopStatus(options);if(status.running)return {...status,alreadyRunning:true};
100
+ const status=await desktopStatus(options);if(status.running)return {...status,alreadyRunning:true,...status.returnStyle!==returnStyle?{requestedReturnStyle:returnStyle,restartRequired:true}:{}};
100
101
  if(status.stale)await stopDesktop(options);
101
102
  const helper=await desktopHelper(options);
102
103
  return new Promise((resolve,reject)=>{
103
- const child=spawn(process.execPath,[fileURLToPath(new URL('./worker.mjs',import.meta.url)),'--helper-spec',JSON.stringify(helper)],{detached:true,windowsHide:true,stdio:['ignore','ignore','ignore','ipc'],env:{...process.env,RETRIEVIEWER_HOME:getConfigPaths(options).root,RETRIEVIEWER_INK:ink}});
104
+ const child=spawn(process.execPath,[fileURLToPath(new URL('./worker.mjs',import.meta.url)),'--helper-spec',JSON.stringify(helper)],{detached:true,windowsHide:true,stdio:['ignore','ignore','ignore','ipc'],env:{...process.env,RETRIEVIEWER_HOME:getConfigPaths(options).root,RETRIEVIEWER_INK:ink,RETRIEVIEWER_RETURN_STYLE:returnStyle}});
104
105
  let settled=false;const finish=(error,message)=>{if(settled)return;settled=true;clearTimeout(timer);if(child.connected)child.disconnect();child.unref();error?reject(error):resolve(message);};
105
106
  const timer=setTimeout(()=>{if(child.connected)child.send({command:'abort'});finish(Error('Desktop startup timed out; no agent settings changed'));},20000);
106
107
  child.on('error',error=>finish(error));child.on('message',message=>message.error?finish(Error(message.error)):finish(null,message));child.on('exit',code=>finish(Error('Desktop exited during startup ('+code+')')));
@@ -10,6 +10,7 @@ import {controlAddress,parseHelperSpec} from '../desktop/platform.mjs';
10
10
 
11
11
  let helper,pump,timer,server,session,paths,owned=false,stopping=false,frames=0,paintedFrames=0,visible=false,selected=false,pickerVisible=false,pendingViewport=null,lastInteraction=null;
12
12
  let nativeError=null;
13
+ const returnStyle=process.env.RETRIEVIEWER_RETURN_STYLE??'auto';
13
14
  let nativeStderr='';
14
15
  const sendParent=message=>{if(process.connected)process.send(message);};
15
16
  async function stop(){
@@ -33,7 +34,7 @@ try{
33
34
  body+=bytes.toString('utf8');if(body.length>2048)return socket.destroy();if(!body.includes('\n'))return;
34
35
  let command;try{command=JSON.parse(body.split('\n')[0]);}catch{return socket.destroy();}
35
36
  if(command.token!==session.token||!['status','stop'].includes(command.command))return socket.destroy();
36
- socket.end(JSON.stringify(command.command==='stop'?{stopped:true}:{running:true,reachable:true,selected,visible,pickerVisible,frames,paintedFrames,lastInteraction,pid:process.pid,painterPid:helper?.pid,rssBytes:process.memoryUsage().rss})+'\n');
37
+ socket.end(JSON.stringify(command.command==='stop'?{stopped:true}:{running:true,reachable:true,selected,visible,pickerVisible,frames,paintedFrames,lastInteraction,returnStyle,pid:process.pid,painterPid:helper?.pid,rssBytes:process.memoryUsage().rss})+'\n');
37
38
  if(command.command==='stop')stop();
38
39
  });
39
40
  });
@@ -48,7 +49,7 @@ try{
48
49
  reader.on('line',line=>{
49
50
  if(line.length>100000)return stop();let m;try{m=JSON.parse(line);}catch{return stop();}
50
51
  try{
51
- if(m.type==='ready'){pickerVisible=m.pickerVisible===true;sendParent({running:true,windowPicker:pickerVisible,mode:spec.mode,pid:process.pid});}
52
+ if(m.type==='ready'){pickerVisible=m.pickerVisible===true;sendParent({running:true,windowPicker:pickerVisible,mode:spec.mode,returnStyle,pid:process.pid});}
52
53
  else if(m.type==='error'){nativeError=String(m.message??'Desktop painter failed');sendParent({error:nativeError});stop();}
53
54
  else if(m.type==='picker')pickerVisible=m.visible===true;
54
55
  else if(m.type==='viewport'){pendingViewport=m;visible=m.visible;selected=m.selected===true;pump?.viewport(m);}
@@ -58,7 +59,7 @@ try{
58
59
  else if(m.type==='quit')stop();
59
60
  }catch(error){write({type:'error',message:error.message});stop();}
60
61
  });
61
- const {createPet}=await import('../../retrieviewer.mjs');const pet=await createPet();
62
+ const {createPet}=await import('../../retrieviewer.mjs');const pet=await createPet({returnStyle});
62
63
  if(stopping)pet.dispose();else{
63
64
  pump=createFramePump({pet,send:write});if(pendingViewport)pump.viewport(pendingViewport);
64
65
  write({type:'loaded',ink:process.env.RETRIEVIEWER_INK??'cream'});timer=setInterval(()=>{try{pump.tick();}catch(error){write({type:'error',message:error.message});stop();}},1000/spec.fps);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitefoundry/retrieviewer",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "A fluffy Braille desktop pet for Windows and Linux X11, with experimental macOS support and an embeddable TUI engine.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://bitefoundry.github.io/retrieviewer/",
@@ -89,6 +89,7 @@
89
89
  "PUPPY-MEMORY.md",
90
90
  "PUPPY-Q5-COMPARISON.md",
91
91
  "COMFORT-ART.md",
92
+ "WATCH-REDRAW.md",
92
93
  "BUTTERFLY.md",
93
94
  "examples/embed.mjs",
94
95
  "examples/live.mjs",
@@ -109,6 +110,7 @@
109
110
  "puppy-paper-trick-timing.mjs",
110
111
  "puppy-paper-paw-transport.mjs",
111
112
  "puppy-companion-life.mjs",
113
+ "puppy-companion-ball.mjs",
112
114
  "puppy-companion-objects.mjs",
113
115
  "puppy-companion-sprites.mjs",
114
116
  "puppy-comfort-sprites.mjs",
@@ -77,31 +77,33 @@
77
77
  "width": 320,
78
78
  "height": 320,
79
79
  "frames": 162,
80
- "uniqueFrames": 142,
80
+ "uniqueFrames": 128,
81
81
  "sourceSha256": "7918261fb64c57a91739729841fd84c6dd53891196c7fb76ee9c27712ab6ef5d",
82
82
  "sourcePackedSha256": "7785ef65b8a2a5bf6f7ce600fe9957a60d9af82066ff49275bba061eac5392d1",
83
- "encodedBytes": 6232435,
84
- "gzipBytes": 1429202,
85
- "residentPixelBytes": 3874636,
86
- "encodedSha256": "599ee35d1164c84f80dd037c37b11212b72f4bbd91bea7e851205d602bfb672a",
87
- "quantizedSha256": "821706cfd8878f0ec9eb1bf1bf0a423ef273f0fa5c7423a033225793f324dc89",
83
+ "encodedBytes": 5918897,
84
+ "gzipBytes": 1286465,
85
+ "residentPixelBytes": 3680463,
86
+ "encodedSha256": "06b2ab8e0d4ff42600818c8eb96bba4089ba77560c6e9b98a662af3967271c2d",
87
+ "quantizedSha256": "07d919258ed32175fed81cfe848f5336edaf88706a3b04bfb51506f82c1b2083",
88
88
  "watchRegistration": {
89
- "sourceVersion": "0.0.5",
90
- "sourceEncodedSha256": "38cfdfcee9c857c56a14f0a9734cb3301b4a04cb8e1ae3fb2e2b2ffe3666240f",
91
- "canonicalSeat": 50,
92
- "method": "single-source-paw-coordinate-registration",
93
- "protectedHeadNeckRows": 230,
94
- "pawWarpFullFromY": 270,
95
- "groundRow": 300,
96
- "headTranslateY": 0,
97
- "neckUnmodified": true,
98
- "bodyCompositing": false,
99
- "paws": [
100
- 105,
101
- 138,
102
- 185,
103
- 218
89
+ "sourceSize": [
90
+ 1619,
91
+ 972
104
92
  ],
93
+ "scale": 0.7627737226277372,
94
+ "dx": 24.607664233576628,
95
+ "dy": 66.82846715328466,
96
+ "wholeBodyArt": true,
97
+ "bodyCompositing": false,
98
+ "collarMatte": false,
99
+ "nonlinearWarp": false,
100
+ "perKeyScale": false,
101
+ "runtimeCompositing": false,
102
+ "keys": 15,
103
+ "frames": 36,
104
+ "sourceSheetSha256": "34b9bbca507f82c739c39e4b42e2390202863189d6d1b5e6e8ca7293555e19d3",
105
+ "canonicalSeat": 50,
106
+ "method": "authored-whole-body-connected-weight-transfer",
105
107
  "unchangedOtherFrames": true
106
108
  }
107
109
  },
@@ -1,5 +1,18 @@
1
1
  import {grayFrameReader,isGrayFrameSource} from './puppy-frame-store.mjs';
2
2
 
3
+ export function comfortMotionKey(progress,motion){
4
+ if(!Number.isFinite(progress)||progress<0||progress>1)throw Error('Invalid motion progress');
5
+ const age=progress*motion.duration;let key=0;
6
+ while(key<motion.times.length-1&&age>=motion.times[key+1])key++;
7
+ return key;
8
+ }
9
+ export function comfortMotion(pose,info){return pose?.clip==='scramble'?info.scramble:pose?.clip==='pickup'?info.pickups?.[pose.view]:pose?.clip==='carry-trot'?info.carryTrot:pose?.clip==='carry-settle'?info.carryTrot?.settle:null;}
10
+ function validateMotion(motion,count){
11
+ if(!motion||!Array.isArray(motion.frames)||!Array.isArray(motion.times)||motion.frames.length<2||motion.frames.length>32||motion.frames.length!==motion.times.length||motion.times[0]!==0||!Number.isFinite(motion.duration)||motion.duration<=0||motion.duration>3||(motion.cyclic?motion.times.at(-1)>=motion.duration:motion.times.at(-1)!==motion.duration)||motion.frames.some(i=>!Number.isInteger(i)||i<0||i>=count)||motion.times.some((t,i)=>!Number.isFinite(t)||(i&&t<=motion.times[i-1])))throw Error('Invalid fetch motion metadata');
12
+ if(!Array.isArray(motion.floorOffsets)||motion.floorOffsets.length!==motion.frames.length||motion.floorOffsets.some(v=>!Number.isFinite(v)||Math.abs(v)>64))throw Error('Invalid fetch floor metadata');
13
+ if(motion.mouth&&(!Array.isArray(motion.mouth)||motion.mouth.length!==motion.frames.length||motion.mouth.some(p=>!Array.isArray(p)||p.length!==2||p.some(v=>!Number.isFinite(v)||v<0||v>320))))throw Error('Invalid fetch mouth metadata');
14
+ }
15
+
3
16
  // A handful of authored keys, not an expanded 30fps film or a live image morph.
4
17
  // First/last keys are the exact shared seated source; all keys use one scale.
5
18
  export function comfortFrameIndex(progress,info){
@@ -13,14 +26,24 @@ export function comfortFrameIndex(progress,info){
13
26
  }
14
27
 
15
28
  export function createComfortSpriteSampler(bytes,info,output){
16
- if(!isGrayFrameSource(bytes)||![1,2].includes(info?.version)||info.width!==320||info.height!==320||info.frames!==(info.version===2?13:9))throw Error('Invalid comfort sprites');
29
+ if(!isGrayFrameSource(bytes)||![1,2,3,4,5,6].includes(info?.version)||info.width!==320||info.height!==320||(info.version>=4?(!Number.isInteger(info.frames)||info.frames<19||info.frames>64):info.frames!==({1:9,2:13,3:19}[info.version])))throw Error('Invalid comfort sprites');
30
+ if(info.version===3){
31
+ const s=info.scramble;
32
+ if(!s||!Array.isArray(s.frames)||!Array.isArray(s.times)||s.frames.length!==7||s.times.length!==7||s.times[0]!==0||!Number.isFinite(s.duration)||s.duration<=0||s.duration>3||s.times.at(-1)!==s.duration||s.frames[0]!==s.frames.at(-1)||s.frames.some(i=>!Number.isInteger(i)||i<0||i>=info.frames)||s.times.some((t,i)=>!Number.isFinite(t)||(i&&t<=s.times[i-1])))throw Error('Invalid scramble metadata');
33
+ }
34
+ if(info.version>=4){validateMotion(info.scramble,info.frames);for(const view of ['rear','front'])validateMotion(info.pickups?.[view],info.frames);}
35
+ if(info.version>=6){validateMotion(info.carryTrot,info.frames);validateMotion(info.carryTrot?.settle,info.frames);if(info.carryTrot.cyclic!==true||!info.carryTrot.mouth||!info.carryTrot.settle.mouth||!Array.isArray(info.carryTrot.feet)||info.carryTrot.feet.length!==info.carryTrot.frames.length||info.carryTrot.feet.some(list=>!Array.isArray(list)||list.some(f=>typeof f.id!=='string'||typeof f.stance!=='boolean'||![f.x,f.y].every(v=>Number.isFinite(v)&&v>=0&&v<320))))throw Error('Invalid carry metadata');}
17
36
  if(output!==undefined&&(!(output instanceof Uint8ClampedArray)||output.length!==320*320*4))throw Error('Invalid comfort output');
18
37
  const frames=grayFrameReader(bytes,320,320,info.frames);let rgba=output??null;
19
38
  if(rgba)for(let i=3;i<rgba.length;i+=4)rgba[i]=255;
20
39
  return pose=>{
21
- if(!['tug','sleep'].includes(pose?.clip))throw Error('Invalid comfort clip');
40
+ if(!['tug','sleep','scramble','pickup','carry-trot','carry-settle'].includes(pose?.clip))throw Error('Invalid comfort clip');
22
41
  if(!rgba){rgba=new Uint8ClampedArray(320*320*4);for(let i=3;i<rgba.length;i+=4)rgba[i]=255;}
23
- const index=pose.clip==='sleep'?info.sleep?.[pose.variant]:comfortFrameIndex(pose.progress,info);
42
+ let index;
43
+ if(['scramble','pickup','carry-trot','carry-settle'].includes(pose.clip)){
44
+ const motion=comfortMotion(pose,info);if(!motion)throw Error('Invalid scramble/pickup pose');
45
+ index=motion.frames[comfortMotionKey(pose.progress,motion)];
46
+ }else index=pose.clip==='sleep'?info.sleep?.[pose.variant]:comfortFrameIndex(pose.progress,info);
24
47
  if(!Number.isInteger(index))throw Error('Invalid sleep variant');
25
48
  const frame=frames.getFrame(index),base=pose.base,blend=pose.blend??1;
26
49
  if(!Number.isFinite(blend)||blend<0||blend>1)throw Error('Invalid sleep blend');
@@ -0,0 +1,36 @@
1
+ // Analytic ball travel in the same ground/camera as the dog. No physics engine,
2
+ // per-frame integration drift, timer, image or growing path-history allocation.
3
+ import {planPaperTravel} from './puppy-paper-world.mjs';
4
+ export function createBallPath({from={x:0,z:.2},landing={x:0,z:-4},stop=landing,flight=.65,peak=.75,deceleration=.6}={}){
5
+ if(![from.x,from.z,landing.x,landing.z,stop.x,stop.z,flight,peak,deceleration].every(Number.isFinite)||flight<0||peak<0||deceleration<=0)throw Error('Invalid ball path');
6
+ from=Object.freeze({...from});landing=Object.freeze({...landing});stop=Object.freeze({...stop});
7
+ const dx=stop.x-landing.x,dz=stop.z-landing.z,distance=Math.hypot(dx,dz),speed=Math.sqrt(2*deceleration*distance);
8
+ const roll=distance?planPaperTravel(distance,{speed,startSpeed:speed,acceleration:deceleration,deceleration}):null;
9
+ const duration=flight+(roll?.duration??0);
10
+ return Object.freeze({duration,from,landing,stop,
11
+ at(age){
12
+ if(!Number.isFinite(age))throw Error('Invalid ball age');
13
+ const t=Math.max(0,age);
14
+ if(t<flight){const p=t/flight;return{x:from.x+(landing.x-from.x)*p,z:from.z+(landing.z-from.z)*p,height:4*peak*p*(1-p),spin:0,speed:0,phase:'flight',settled:false};}
15
+ const state=roll?.at(t-flight),ratio=distance?state.distance/distance:1;
16
+ return{x:landing.x+dx*ratio,z:landing.z+dz*ratio,height:0,spin:(state?.distance??0)/.035,speed:state?.speed??0,phase:t>=duration?'rest':'roll',settled:t>=duration};
17
+ }
18
+ });
19
+ }
20
+
21
+ // First throw remains the familiar clean fetch. Later throws use a seeded
22
+ // weighted choice, no immediate repeat, and at least four throws between tumbles.
23
+ export function createFetchPatterns(random,{canTumble=false}={}){
24
+ if(typeof random!=='function')throw Error('Fetch pattern RNG is required');
25
+ let count=0,last=null,lastTumble=-4;
26
+ return(allowTumble=canTumble)=>{
27
+ if(typeof allowTumble!=='boolean')throw Error('Invalid tumble availability');
28
+ count++;
29
+ const weights={clean:4,rolling:3,miss:2,tumble:canTumble&&allowTumble&&count>=4&&count-lastTumble>=4?.6:0};
30
+ if(last)weights[last]=0;
31
+ let pattern='clean';
32
+ if(count>1){let pick=random()*Object.values(weights).reduce((a,b)=>a+b,0);pattern=Object.keys(weights).find(k=>(pick-=weights[k])<0)??'clean';}
33
+ if(pattern==='tumble')lastTumble=count;
34
+ last=pattern;return pattern;
35
+ };
36
+ }
Binary file