instar 1.3.81 → 1.3.83

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.
@@ -59,36 +59,54 @@ fi
59
59
  # Known-safe domains are whitelisted; anything else gets flagged.
60
60
  URLS_IN_MSG=$(echo "$CONTENT" | grep -oE 'https?://[^ )"'"'"'>]+' 2>/dev/null || true)
61
61
  if [ -n "$URLS_IN_MSG" ]; then
62
- # The agent's OWN tunnel domain is trusted — a private-view / dashboard link
63
- # the agent just generated via POST /view is not a confabulation. Read the
64
- # live tunnel host from the persisted tunnel state so custom-domain tunnels
65
- # are covered too (not just the default *.dawn-tunnel.dev / *.trycloudflare.com).
62
+ # The agent's OWN configured tunnel hostname is trusted — a private-view,
63
+ # dashboard, or Secret Drop link generated by this agent is not a
64
+ # confabulation. Read it from config at runtime. If config/python is
65
+ # unavailable or tunnel.hostname is empty, fall back to the static allowlist.
66
66
  OWN_TUNNEL_HOST=""
67
- for tj in "${CLAUDE_PROJECT_DIR:-.}/.instar/state/tunnel.json" "${CLAUDE_PROJECT_DIR:-.}/.instar/tunnel.json"; do
68
- if [ -f "$tj" ]; then
69
- OWN_TUNNEL_HOST=$(python3 -c "
70
- import json,sys,re
67
+ CONFIG_PATH="${CLAUDE_PROJECT_DIR:-.}/.instar/config.json"
68
+ if [ -f "$CONFIG_PATH" ]; then
69
+ OWN_TUNNEL_HOST=$(python3 - "$CONFIG_PATH" <<'PY' 2>/dev/null
70
+ import json
71
+ import sys
72
+ from urllib.parse import urlparse
73
+
71
74
  try:
72
- d=json.load(open('$tj'))
73
- u=d.get('url') or d.get('tunnelUrl') or ''
74
- m=re.search(r'https?://([^/]+)', u)
75
- print(re.escape(m.group(1)) if m else '')
75
+ cfg = json.load(open(sys.argv[1]))
76
+ raw = ((cfg.get('tunnel') or {}).get('hostname') or '').strip()
77
+ if not raw:
78
+ print('')
79
+ else:
80
+ parsed = urlparse(raw if '://' in raw else f'https://{raw}')
81
+ print((parsed.hostname or '').lower())
76
82
  except Exception:
77
83
  print('')
78
- " 2>/dev/null)
79
- [ -n "$OWN_TUNNEL_HOST" ] && break
80
- fi
81
- done
84
+ PY
85
+ )
86
+ fi
82
87
 
83
88
  UNFAMILIAR_URLS=""
84
89
  while IFS= read -r url; do
85
90
  [ -z "$url" ] && continue
86
- # Skip the agent's own live tunnel host (dynamic, covers custom domains).
87
- if [ -n "$OWN_TUNNEL_HOST" ] && echo "$url" | grep -qE "$OWN_TUNNEL_HOST"; then
91
+ URL_HOST=$(python3 - "$url" <<'PY' 2>/dev/null
92
+ import sys
93
+ from urllib.parse import urlparse
94
+ try:
95
+ print((urlparse(sys.argv[1]).hostname or '').lower())
96
+ except Exception:
97
+ print('')
98
+ PY
99
+ )
100
+ # Skip the agent's own configured tunnel host.
101
+ if [ -n "$OWN_TUNNEL_HOST" ] && [ "$URL_HOST" = "$OWN_TUNNEL_HOST" ]; then
102
+ continue
103
+ fi
104
+ # Skip Cloudflare quick-tunnel hosts. These are ephemeral but agent-generated.
105
+ if echo "$URL_HOST" | grep -qE '(^|\.)trycloudflare\.com$'; then
88
106
  continue
89
107
  fi
90
108
  # Skip well-known service domains + common agent tunnel domains.
91
- if echo "$url" | grep -qE '(github\.com|vercel\.app|vercel\.com|netlify\.app|netlify\.com|npmjs\.com|npmjs\.org|cloudflare\.com|google\.com|twitter\.com|x\.com|youtube\.com|reddit\.com|discord\.com|discord\.gg|telegram\.org|t\.me|localhost|127\.0\.0\.1|stackoverflow\.com|developer\.mozilla\.org|docs\.anthropic\.com|anthropic\.com|openai\.com|claude\.ai|notion\.so|linear\.app|fly\.io|render\.com|railway\.app|heroku\.com|amazonaws\.com|azure\.com|gitlab\.com|bitbucket\.org|docker\.com|hub\.docker\.com|pypi\.org|crates\.io|rubygems\.org|pkg\.go\.dev|wikipedia\.org|medium\.com|substack\.com|circle\.so|ghost\.io|telegraph\.ph|dawn-tunnel\.dev|trycloudflare\.com)'; then
109
+ if echo "$url" | grep -qE '(github\.com|vercel\.app|vercel\.com|netlify\.app|netlify\.com|npmjs\.com|npmjs\.org|cloudflare\.com|google\.com|twitter\.com|x\.com|youtube\.com|reddit\.com|discord\.com|discord\.gg|telegram\.org|t\.me|localhost|127\.0\.0\.1|stackoverflow\.com|developer\.mozilla\.org|docs\.anthropic\.com|anthropic\.com|openai\.com|claude\.ai|notion\.so|linear\.app|fly\.io|render\.com|railway\.app|heroku\.com|amazonaws\.com|azure\.com|gitlab\.com|bitbucket\.org|docker\.com|hub\.docker\.com|pypi\.org|crates\.io|rubygems\.org|pkg\.go\.dev|wikipedia\.org|medium\.com|substack\.com|circle\.so|ghost\.io|telegraph\.ph)'; then
92
110
  continue
93
111
  fi
94
112
  UNFAMILIAR_URLS="$UNFAMILIAR_URLS $url\n"
@@ -0,0 +1,23 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- bump: patch -->
4
+
5
+ ## What Changed
6
+
7
+ The pre-message URL provenance check now recognizes the agent's own configured tunnel hostname and Cloudflare quick-tunnel hosts. This fixes a Secret Drop dogfood failure where the agent generated a legitimate one-time collection link, but the convergence check treated the tunnel URL as an unfamiliar fabricated domain. The fix also covers private-view links served over the same tunnel path. Random unfamiliar domains still flag.
8
+
9
+ ## What to Tell Your User
10
+
11
+ I can now send my own Secret Drop and private-view links through the normal chat path without the pre-message URL check mistaking them for made-up outside links.
12
+
13
+ ## Summary of New Capabilities
14
+
15
+ | Area | Capability |
16
+ | --- | --- |
17
+ | Secret Drop | One-time links served on the agent's own tunnel pass the pre-message URL provenance check. |
18
+ | Private views | Agent-generated view links on the configured tunnel no longer trip the fabricated-URL guard. |
19
+ | Message safety | Random unfamiliar domains still flag, and missing config falls back to the existing conservative behavior. |
20
+
21
+ ## Evidence
22
+
23
+ - Unit coverage: `tests/unit/convergence-check.test.ts` verifies configured tunnel URLs and Cloudflare quick-tunnel URLs pass, while random fabricated domains still raise URL provenance warnings when config is missing.
@@ -0,0 +1,25 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- bump: patch -->
4
+
5
+ ## What Changed
6
+
7
+ Project Map now includes a concise related-worktrees section when an agent has source worktrees in its conventional workspace. This fixes a dogfood issue where Codey's map was technically fresh and accurate for the small wrapper project, but omitted the Instar source worktrees where the real development work was happening. The headline file count also now skips hidden state/worktree directories consistently with the visible directory breakdown, so aged agents with large transcript/state folders do not get noisy inflated totals.
8
+
9
+ ## What to Tell Your User
10
+
11
+ Project Map now gives me better spatial awareness when I’m developing through nearby source worktrees, and its headline file count is less likely to be inflated by hidden runtime state.
12
+
13
+ ## Summary of New Capabilities
14
+
15
+ | Area | Capability |
16
+ | --- | --- |
17
+ | Project Map | Compact and markdown maps can show related agent worktrees when they exist. |
18
+ | Spatial awareness | Development agents can see nearby source worktrees without scanning the whole machine. |
19
+ | Count accuracy | Hidden state and worktree directories no longer inflate the headline project file count. |
20
+ | Refresh safety | Agents without related worktrees keep the existing compact map behavior. |
21
+
22
+ ## Evidence
23
+
24
+ - Unit coverage: `tests/unit/ProjectMapper.test.ts` verifies related worktree discovery and compact/markdown rendering.
25
+ - Integration coverage: `tests/integration/coherence-routes.test.ts` verifies the Project Map API routes still serve JSON, markdown, compact, and refresh responses.
@@ -0,0 +1,82 @@
1
+ # Side-Effects Review — Convergence Check Own Tunnel URL Allowlist
2
+
3
+ **Version / slug:** `convergence-check-own-tunnel-url`
4
+ **Date:** `2026-05-29`
5
+ **Author:** `instar-codey`
6
+ **Second-pass reviewer:** `not required by tooling`
7
+
8
+ ## Summary of the change
9
+
10
+ This change updates the shipped `convergence-check.sh` template so URL provenance accepts the agent's own configured tunnel hostname and Cloudflare quick-tunnel hosts while preserving unfamiliar-domain blocking. It adds unit coverage in `tests/unit/convergence-check.test.ts` for configured tunnel URLs, quick-tunnel URLs, and missing-config fallback.
11
+
12
+ ## Decision-point inventory
13
+
14
+ - `convergence-check.sh` URL provenance check — modify — deterministic pre-message quality gate deciding whether a URL host is familiar enough to send without warning.
15
+
16
+ ---
17
+
18
+ ## 1. Over-block
19
+
20
+ This reduces the observed over-block where self-generated Secret Drop and private-view links on the agent's tunnel were classified as fabricated. Remaining over-block: if an agent serves a user-facing link through a tunnel hostname that is not in config and is not a Cloudflare quick-tunnel hostname, the check may still flag it.
21
+
22
+ ---
23
+
24
+ ## 2. Under-block
25
+
26
+ The under-block risk is allowing a bad URL on the agent's own configured tunnel host. That risk is bounded because the hostname belongs to the agent's server, and the path still points back to this agent rather than an arbitrary external domain. A random unfamiliar domain still flags.
27
+
28
+ ---
29
+
30
+ ## 3. Level-of-abstraction fit
31
+
32
+ This is a deterministic structural check over URL host provenance, so the shell pre-message gate is the right layer. It does not try to judge message meaning; it only distinguishes known host classes from unknown host classes.
33
+
34
+ ---
35
+
36
+ ## 4. Signal vs authority compliance
37
+
38
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
39
+
40
+ - [x] No — this change has no conversational block/allow surface.
41
+
42
+ This is a hard provenance invariant, not a semantic judgment. The check stays narrow and deterministic: exact configured host, loopback, known public domains, and Cloudflare quick-tunnel hosts.
43
+
44
+ ---
45
+
46
+ ## 5. Interactions
47
+
48
+ - **Shadowing:** This runs before the server-side tone gate. It only prevents false URL-provenance blocks before the message reaches the tone gate.
49
+ - **Double-fire:** No double action. The convergence check either passes or reports a warning; normal message delivery then proceeds.
50
+ - **Races:** The script reads config at send time. If the config is temporarily absent or malformed, it falls back to existing behavior.
51
+ - **Feedback loops:** Positive loop: agents can use Secret Drop and private views instead of less safe credential or report-sharing workarounds.
52
+
53
+ ---
54
+
55
+ ## 6. External surfaces
56
+
57
+ Users can receive self-generated tunnel links for Secret Drop and private views through the normal messaging path. Other unfamiliar URLs are unchanged and still flagged. Existing agents receive the fix because PostUpdateMigrator overwrites the convergence-check template during migration.
58
+
59
+ ---
60
+
61
+ ## 7. Rollback cost
62
+
63
+ Rollback is a normal hot-fix revert. No data migration or state repair is required. During rollback propagation, agents may again over-block their own tunnel links.
64
+
65
+ ---
66
+
67
+ ## Conclusion
68
+
69
+ The change is clear to ship. It addresses the observed Secret Drop and private-view false-positive without broadly weakening URL provenance.
70
+
71
+ ---
72
+
73
+ ## Second-pass review (if required)
74
+
75
+ **Reviewer:** `not required by tooling`
76
+ **Independent read of the artifact:** `not required`
77
+
78
+ ---
79
+
80
+ ## Evidence pointers
81
+
82
+ - `tests/unit/convergence-check.test.ts`
@@ -0,0 +1,85 @@
1
+ # Side-Effects Review — Project Map Related Worktrees
2
+
3
+ **Version / slug:** `project-map-related-worktrees`
4
+ **Date:** `2026-05-29`
5
+ **Author:** `instar-codey`
6
+ **Second-pass reviewer:** `not required by tooling`
7
+
8
+ ## Summary of the change
9
+
10
+ This change extends Project Map with a concise related-worktrees summary and makes the headline total file count skip hidden directories consistently with the visible top-level breakdown. The existing project-root map remains the primary output, and related git worktrees are discovered only from configured roots plus the conventional agent worktree directory derived from the project directory name.
11
+
12
+ ## Decision-point inventory
13
+
14
+ - `ProjectMapper.generate()` — add optional related-worktree metadata to generated maps.
15
+ - `ProjectMapper.toMarkdown()` and `getCompactSummary()` — display related worktrees when present.
16
+ - `ProjectMapper.countFiles()` — skip hidden directories consistently at every depth so hidden state does not inflate the headline total.
17
+
18
+ ---
19
+
20
+ ## 1. Over-block
21
+
22
+ No blocking behavior changes. This is read-only reporting.
23
+
24
+ ---
25
+
26
+ ## 2. Under-block
27
+
28
+ No authorization or safety gate changes. The mapper does not make worktree placement decisions and does not suppress existing worktree detector findings.
29
+
30
+ ---
31
+
32
+ ## 3. Level-of-abstraction fit
33
+
34
+ Project Map already owns spatial awareness for the current workspace. Reporting nearby conventional worktrees belongs at this layer because it helps the agent understand the real working surface without coupling the session-start context to worktree-manager internals.
35
+
36
+ ---
37
+
38
+ ## 4. Signal vs authority compliance
39
+
40
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
41
+
42
+ - [x] No — this change has no conversational block/allow surface.
43
+
44
+ The output is informational. It helps orientation but does not authorize edits or replace coherence checks.
45
+
46
+ ---
47
+
48
+ ## 5. Interactions
49
+
50
+ - **Shadowing:** None. Worktree safety remains owned by the worktree manager and detector.
51
+ - **Double-fire:** None. Refresh still writes one JSON map and one markdown map.
52
+ - **Races:** A worktree can be created or removed while the map is generating. The mapper handles missing or unreadable entries by skipping them, preserving refresh reliability.
53
+ - **Feedback loops:** Positive loop: agents should be less likely to overlook the source worktrees they are actively using.
54
+
55
+ ---
56
+
57
+ ## 6. External surfaces
58
+
59
+ Users and agents will see a related-worktrees section in Project Map JSON, markdown, and compact output when conventional worktrees exist. Agents without such worktrees keep effectively the same map, except headline totals become less noisy if hidden state directories were previously included.
60
+
61
+ ---
62
+
63
+ ## 7. Rollback cost
64
+
65
+ Rollback is a normal code revert. Saved maps with the optional related-worktrees field remain harmless if older code ignores it.
66
+
67
+ ---
68
+
69
+ ## Conclusion
70
+
71
+ The change is clear to ship. It fixes real spatial-awareness and count-consistency gaps found during Project Map dogfooding without widening the mapper into a broad filesystem scanner.
72
+
73
+ ---
74
+
75
+ ## Second-pass review (if required)
76
+
77
+ **Reviewer:** `not required by tooling`
78
+ **Independent read of the artifact:** `not required`
79
+
80
+ ---
81
+
82
+ ## Evidence pointers
83
+
84
+ - `tests/unit/ProjectMapper.test.ts`
85
+ - `tests/integration/coherence-routes.test.ts`