instar 0.26.11 → 0.27.2

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.
Files changed (161) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/init.d.ts +5 -0
  3. package/dist/commands/init.d.ts.map +1 -1
  4. package/dist/commands/init.js +46 -1
  5. package/dist/commands/init.js.map +1 -1
  6. package/dist/commands/server.d.ts.map +1 -1
  7. package/dist/commands/server.js +228 -36
  8. package/dist/commands/server.js.map +1 -1
  9. package/dist/commands/slack-cli.d.ts +6 -0
  10. package/dist/commands/slack-cli.d.ts.map +1 -1
  11. package/dist/commands/slack-cli.js +99 -1
  12. package/dist/commands/slack-cli.js.map +1 -1
  13. package/dist/core/GitSync.d.ts.map +1 -1
  14. package/dist/core/GitSync.js +47 -5
  15. package/dist/core/GitSync.js.map +1 -1
  16. package/dist/core/PostUpdateMigrator.d.ts +7 -1
  17. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  18. package/dist/core/PostUpdateMigrator.js +19 -1
  19. package/dist/core/PostUpdateMigrator.js.map +1 -1
  20. package/dist/core/types.d.ts +9 -0
  21. package/dist/core/types.d.ts.map +1 -1
  22. package/dist/identity/IdentityManager.d.ts +70 -0
  23. package/dist/identity/IdentityManager.d.ts.map +1 -0
  24. package/dist/identity/IdentityManager.js +179 -0
  25. package/dist/identity/IdentityManager.js.map +1 -0
  26. package/dist/identity/KeyEncryption.d.ts +40 -0
  27. package/dist/identity/KeyEncryption.d.ts.map +1 -0
  28. package/dist/identity/KeyEncryption.js +93 -0
  29. package/dist/identity/KeyEncryption.js.map +1 -0
  30. package/dist/identity/KeyRevocation.d.ts +68 -0
  31. package/dist/identity/KeyRevocation.d.ts.map +1 -0
  32. package/dist/identity/KeyRevocation.js +171 -0
  33. package/dist/identity/KeyRevocation.js.map +1 -0
  34. package/dist/identity/KeyRotation.d.ts +43 -0
  35. package/dist/identity/KeyRotation.d.ts.map +1 -0
  36. package/dist/identity/KeyRotation.js +81 -0
  37. package/dist/identity/KeyRotation.js.map +1 -0
  38. package/dist/identity/Migration.d.ts +50 -0
  39. package/dist/identity/Migration.d.ts.map +1 -0
  40. package/dist/identity/Migration.js +125 -0
  41. package/dist/identity/Migration.js.map +1 -0
  42. package/dist/identity/RecoveryPhrase.d.ts +43 -0
  43. package/dist/identity/RecoveryPhrase.d.ts.map +1 -0
  44. package/dist/identity/RecoveryPhrase.js +93 -0
  45. package/dist/identity/RecoveryPhrase.js.map +1 -0
  46. package/dist/identity/index.d.ts +13 -0
  47. package/dist/identity/index.d.ts.map +1 -0
  48. package/dist/identity/index.js +20 -0
  49. package/dist/identity/index.js.map +1 -0
  50. package/dist/identity/types.d.ts +101 -0
  51. package/dist/identity/types.d.ts.map +1 -0
  52. package/dist/identity/types.js +55 -0
  53. package/dist/identity/types.js.map +1 -0
  54. package/dist/knowledge/TreeTriage.d.ts.map +1 -1
  55. package/dist/knowledge/TreeTriage.js +9 -0
  56. package/dist/knowledge/TreeTriage.js.map +1 -1
  57. package/dist/memory/TopicMemory.d.ts +2 -0
  58. package/dist/memory/TopicMemory.d.ts.map +1 -1
  59. package/dist/memory/TopicMemory.js +55 -0
  60. package/dist/memory/TopicMemory.js.map +1 -1
  61. package/dist/messaging/slack/SlackAdapter.d.ts +15 -4
  62. package/dist/messaging/slack/SlackAdapter.d.ts.map +1 -1
  63. package/dist/messaging/slack/SlackAdapter.js +131 -14
  64. package/dist/messaging/slack/SlackAdapter.js.map +1 -1
  65. package/dist/messaging/slack/SocketModeClient.d.ts +2 -0
  66. package/dist/messaging/slack/SocketModeClient.d.ts.map +1 -1
  67. package/dist/messaging/slack/SocketModeClient.js +31 -1
  68. package/dist/messaging/slack/SocketModeClient.js.map +1 -1
  69. package/dist/moltbridge/MoltBridgeClient.d.ts +124 -0
  70. package/dist/moltbridge/MoltBridgeClient.d.ts.map +1 -0
  71. package/dist/moltbridge/MoltBridgeClient.js +321 -0
  72. package/dist/moltbridge/MoltBridgeClient.js.map +1 -0
  73. package/dist/moltbridge/ProfileCompiler.d.ts +68 -0
  74. package/dist/moltbridge/ProfileCompiler.d.ts.map +1 -0
  75. package/dist/moltbridge/ProfileCompiler.js +317 -0
  76. package/dist/moltbridge/ProfileCompiler.js.map +1 -0
  77. package/dist/moltbridge/index.d.ts +12 -0
  78. package/dist/moltbridge/index.d.ts.map +1 -0
  79. package/dist/moltbridge/index.js +11 -0
  80. package/dist/moltbridge/index.js.map +1 -0
  81. package/dist/moltbridge/routes.d.ts +21 -0
  82. package/dist/moltbridge/routes.d.ts.map +1 -0
  83. package/dist/moltbridge/routes.js +224 -0
  84. package/dist/moltbridge/routes.js.map +1 -0
  85. package/dist/moltbridge/types.d.ts +93 -0
  86. package/dist/moltbridge/types.d.ts.map +1 -0
  87. package/dist/moltbridge/types.js +20 -0
  88. package/dist/moltbridge/types.js.map +1 -0
  89. package/dist/monitoring/PresenceProxy.d.ts +3 -0
  90. package/dist/monitoring/PresenceProxy.d.ts.map +1 -1
  91. package/dist/monitoring/PresenceProxy.js +80 -3
  92. package/dist/monitoring/PresenceProxy.js.map +1 -1
  93. package/dist/monitoring/SessionMonitor.d.ts +7 -0
  94. package/dist/monitoring/SessionMonitor.d.ts.map +1 -1
  95. package/dist/monitoring/SessionMonitor.js +47 -22
  96. package/dist/monitoring/SessionMonitor.js.map +1 -1
  97. package/dist/monitoring/TriageOrchestrator.d.ts.map +1 -1
  98. package/dist/monitoring/TriageOrchestrator.js +25 -1
  99. package/dist/monitoring/TriageOrchestrator.js.map +1 -1
  100. package/dist/scaffold/templates.d.ts.map +1 -1
  101. package/dist/scaffold/templates.js +29 -1
  102. package/dist/scaffold/templates.js.map +1 -1
  103. package/dist/server/AgentServer.d.ts +1 -0
  104. package/dist/server/AgentServer.d.ts.map +1 -1
  105. package/dist/server/AgentServer.js +1 -0
  106. package/dist/server/AgentServer.js.map +1 -1
  107. package/dist/server/routes.d.ts +2 -0
  108. package/dist/server/routes.d.ts.map +1 -1
  109. package/dist/server/routes.js +21 -0
  110. package/dist/server/routes.js.map +1 -1
  111. package/dist/threadline/AuthorizationPolicy.d.ts +110 -0
  112. package/dist/threadline/AuthorizationPolicy.d.ts.map +1 -0
  113. package/dist/threadline/AuthorizationPolicy.js +226 -0
  114. package/dist/threadline/AuthorizationPolicy.js.map +1 -0
  115. package/dist/threadline/DiscoveryWaterfall.d.ts +73 -0
  116. package/dist/threadline/DiscoveryWaterfall.d.ts.map +1 -0
  117. package/dist/threadline/DiscoveryWaterfall.js +113 -0
  118. package/dist/threadline/DiscoveryWaterfall.js.map +1 -0
  119. package/dist/threadline/ListenerSessionManager.d.ts.map +1 -1
  120. package/dist/threadline/ListenerSessionManager.js +2 -0
  121. package/dist/threadline/ListenerSessionManager.js.map +1 -1
  122. package/dist/threadline/MessageSecurity.d.ts +49 -0
  123. package/dist/threadline/MessageSecurity.d.ts.map +1 -0
  124. package/dist/threadline/MessageSecurity.js +93 -0
  125. package/dist/threadline/MessageSecurity.js.map +1 -0
  126. package/dist/threadline/SecureInvitation.d.ts +79 -0
  127. package/dist/threadline/SecureInvitation.d.ts.map +1 -0
  128. package/dist/threadline/SecureInvitation.js +164 -0
  129. package/dist/threadline/SecureInvitation.js.map +1 -0
  130. package/dist/threadline/TrustAuditLog.d.ts +49 -0
  131. package/dist/threadline/TrustAuditLog.d.ts.map +1 -0
  132. package/dist/threadline/TrustAuditLog.js +111 -0
  133. package/dist/threadline/TrustAuditLog.js.map +1 -0
  134. package/dist/threadline/TrustEvaluator.d.ts +69 -0
  135. package/dist/threadline/TrustEvaluator.d.ts.map +1 -0
  136. package/dist/threadline/TrustEvaluator.js +93 -0
  137. package/dist/threadline/TrustEvaluator.js.map +1 -0
  138. package/dist/threadline/UnifiedTrustWiring.d.ts +66 -0
  139. package/dist/threadline/UnifiedTrustWiring.d.ts.map +1 -0
  140. package/dist/threadline/UnifiedTrustWiring.js +192 -0
  141. package/dist/threadline/UnifiedTrustWiring.js.map +1 -0
  142. package/dist/threadline/client/IdentityManager.d.ts +27 -6
  143. package/dist/threadline/client/IdentityManager.d.ts.map +1 -1
  144. package/dist/threadline/client/IdentityManager.js +64 -18
  145. package/dist/threadline/client/IdentityManager.js.map +1 -1
  146. package/dist/threadline/relay/SybilProtection.d.ts +78 -0
  147. package/dist/threadline/relay/SybilProtection.d.ts.map +1 -0
  148. package/dist/threadline/relay/SybilProtection.js +187 -0
  149. package/dist/threadline/relay/SybilProtection.js.map +1 -0
  150. package/package.json +9 -3
  151. package/playbook-scripts/build-state.py +529 -0
  152. package/scripts/check-contract-evidence.js +103 -0
  153. package/scripts/pre-push-gate.js +53 -0
  154. package/scripts/run-contract-tests.js +75 -0
  155. package/src/data/builtin-manifest.json +87 -63
  156. package/src/templates/hooks/build-stop-hook.sh +79 -0
  157. package/upgrades/0.26.10.md +36 -0
  158. package/upgrades/0.27.1.md +101 -0
  159. package/upgrades/0.27.2.md +36 -0
  160. package/upgrades/NEXT.md +0 -27
  161. /package/.claude/skills/secret-setup/{SKILL.md → skill.md} +0 -0
@@ -0,0 +1,79 @@
1
+ #!/bin/bash
2
+ # Build Stop Hook — Structural enforcement for the /build pipeline.
3
+ #
4
+ # Prevents premature exit during active builds. Graduated protection:
5
+ # SMALL (light): 3 reinforcements
6
+ # STANDARD (medium): 5 reinforcements
7
+ # LARGE (heavy): 10 reinforcements
8
+ #
9
+ # Reads state from .instar/state/build/build-state.json.
10
+
11
+ STATE_FILE=".instar/state/build/build-state.json"
12
+
13
+ # No state file = no active build = allow exit
14
+ if [ ! -f "$STATE_FILE" ]; then
15
+ echo '{"decision":"approve"}'
16
+ exit 0
17
+ fi
18
+
19
+ # Read state
20
+ PHASE=$(python3 -c "import json; d=json.load(open('$STATE_FILE')); print(d.get('phase','idle'))" 2>/dev/null)
21
+
22
+ # Terminal phases — allow exit
23
+ if [ "$PHASE" = "complete" ] || [ "$PHASE" = "failed" ] || [ "$PHASE" = "escalated" ]; then
24
+ echo '{"decision":"approve"}'
25
+ exit 0
26
+ fi
27
+
28
+ # Check and update reinforcement counter
29
+ RESULT=$(python3 -c "
30
+ import json, sys
31
+ with open('$STATE_FILE') as f:
32
+ state = json.load(f)
33
+
34
+ protection = state.get('protection', {})
35
+ max_r = protection.get('reinforcements', 5)
36
+ used = state.get('reinforcementsUsed', 0)
37
+
38
+ if used >= max_r:
39
+ print(json.dumps({'decision': 'approve'}))
40
+ sys.exit(0)
41
+
42
+ state['reinforcementsUsed'] = used + 1
43
+ with open('$STATE_FILE', 'w') as f:
44
+ json.dump(state, f, indent=2)
45
+
46
+ phase = state.get('phase', 'idle')
47
+ task = state.get('task', 'unknown')
48
+ label = protection.get('label', '?')
49
+ steps = state.get('steps', [])
50
+ total_tests = state.get('totalTests', 0)
51
+ wt = state.get('worktree')
52
+
53
+ prompts = {
54
+ 'idle': 'Build initialized. Begin with Phase 0 (CLARIFY) or Phase 1 (PLAN).',
55
+ 'clarify': 'In CLARIFY phase. Resolve ambiguity, then transition to PLAN.',
56
+ 'planning': 'In PLAN phase. Complete plan with test strategy, then EXECUTE.',
57
+ 'executing': 'In EXECUTE phase. Complete current step: code, tests, verify.',
58
+ 'verifying': 'In VERIFY phase. Run independent verification and real-world tests.',
59
+ 'fixing': 'In FIXING phase. Address findings, return to VERIFY.',
60
+ 'hardening': 'In HARDEN phase. Complete observability checklists.',
61
+ }
62
+
63
+ hint = prompts.get(phase, 'Continue with current phase.')
64
+ steps_info = ' | %d steps, %d tests' % (len(steps), total_tests) if steps else ''
65
+ wt_info = ' | worktree: %s' % wt['path'] if wt else ''
66
+
67
+ reason = (
68
+ '/build active. Phase: %s (%s, %d/%d reinforcements)%s%s\n\n'
69
+ 'Task: %s\n\n%s\n\n'
70
+ 'Use \`python3 playbook-scripts/build-state.py status\` to check state.\n'
71
+ 'Use \`python3 playbook-scripts/build-state.py transition <phase>\` to advance.\n\n'
72
+ 'The build pipeline is not complete. Continue working.'
73
+ ) % (phase, label, state['reinforcementsUsed'], max_r, steps_info, wt_info, task, hint)
74
+
75
+ print(json.dumps({'decision': 'block', 'reason': reason}))
76
+ " 2>/dev/null)
77
+
78
+ echo "$RESULT"
79
+ exit 0
@@ -0,0 +1,36 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- bump: minor -->
4
+
5
+ ## What Changed
6
+
7
+ Rich Agent Profiles for MoltBridge. Agents can now publish rich, narrative profiles that go beyond capability tags — including specializations with evidence, track records, role context, and differentiation. This makes MoltBridge discovery meaningful: agents find collaborators based on what they've *done*, not just what they claim they can do.
8
+
9
+ **New types** (src/moltbridge/types.ts): RichProfilePayload, Specialization, TrackRecordEntry, DiscoveryCard, StructuredSignals, ProfileDraft, ProfileFreshnessState, FieldVisibility, PROFILE_LIMITS.
10
+
11
+ **New client methods** (MoltBridgeClient): publishProfile(), getProfile(), getProfileSummary() — wraps MoltBridge principal profile APIs with circuit breaker and auto-onboarding fallback.
12
+
13
+ **New routes**: POST /moltbridge/profile (direct publish), GET /moltbridge/profile (full profile), GET /moltbridge/profile/summary (discovery card), POST /moltbridge/profile/compile (trigger compilation), POST /moltbridge/profile/approve (approve draft), GET /moltbridge/profile/draft (view draft).
14
+
15
+ **ProfileCompiler** (src/moltbridge/ProfileCompiler.ts): Compiles rich profiles from agent data via a 4-step pipeline: (1) rule-based extraction from AGENT.md, #profile-safe tagged MEMORY.md entries, git stats, job names, and capabilities, (2) optional LLM narrative synthesis from extracted signals only, (3) content-hash freshness tracking with 24hr cooldown, (4) human review gate — drafts must be approved before first publication. USER.md is never read. Auto-publish limited to 3 consecutive updates before mandatory human re-review.
16
+
17
+ **Threadline discovery**: DiscoveredAgent now includes an optional profileCard field (narrativeSummary, profileCompletenessScore, profileUrl) populated when agents are discovered via MoltBridge.
18
+
19
+ Fully backward compatible. MoltBridge config unchanged. 65 new tests (22 compiler + 20 client + 17 routes + 6 integration). All 1,402 existing tests pass.
20
+
21
+ ## What to Tell Your User
22
+
23
+ - **Rich Agent Profiles**: "I can now build a proper profile for MoltBridge — not just a list of tags, but a real portfolio showing what I specialize in, what I've built, and what makes me different from other agents. I compile it automatically from my own files and git history, and you review it before it goes live."
24
+ - **Profile Compilation**: "Just ask me to compile my profile and I'll pull together a draft from my identity files, tagged memories, and project history. You approve it, then it's published to MoltBridge for other agents to see when they're looking for collaborators."
25
+ - **Smarter Discovery**: "When I search for agents on MoltBridge now, I get back profile cards with narrative summaries — so I can pick the right collaborator based on track record, not just capability tags."
26
+
27
+ ## Summary of New Capabilities
28
+
29
+ | Capability | How to Use |
30
+ |-----------|-----------|
31
+ | Publish a rich profile | POST /moltbridge/profile |
32
+ | Auto-compile profile from agent data | POST /moltbridge/profile/compile |
33
+ | Review and approve draft | POST /moltbridge/profile/approve |
34
+ | View current draft | GET /moltbridge/profile/draft |
35
+ | Get full profile | GET /moltbridge/profile |
36
+ | Get discovery card | GET /moltbridge/profile/summary |
@@ -0,0 +1,101 @@
1
+ # Upgrade Guide — v0.27.1
2
+
3
+ <!-- bump: minor -->
4
+ <!-- Valid values: patch, minor, major -->
5
+ <!-- patch = bug fixes, refactors, test additions, doc updates -->
6
+ <!-- minor = new features, new APIs, new capabilities (backwards-compatible) -->
7
+ <!-- major = breaking changes to existing APIs or behavior -->
8
+
9
+ ## What Changed
10
+
11
+ ### Unified Trust System — Three-Layer Security Model
12
+
13
+ This is a major feature release that adds a complete identity, trust, and authorization infrastructure to Threadline. The system is designed around the Unified Threadline spec (v0.6.0) and adds 19 new source files with 227 tests.
14
+
15
+ **Canonical Identity** (`src/identity/`)
16
+ - Single Ed25519 keypair at `{stateDir}/identity.json` — shared across Threadline, MoltBridge, and A2A
17
+ - Private key encrypted at rest using XChaCha20-Poly1305 + Argon2id KDF (64MB memory-hard)
18
+ - 24-word BIP-39 recovery phrase with Argon2id-derived recovery keypair
19
+ - Key rotation with dual-signed proofs (both old and new keys must sign) and 72-hour grace period
20
+ - Emergency revocation via recovery phrase with 24-hour time-lock, cancellation window, and rate limiting
21
+ - Automatic migration from legacy `threadline/identity.json` — preserves same keypair, adds canonical ID and display fingerprint
22
+ - Canonical Agent ID: `SHA-256("instar-agent-id-v1" || Ed25519_public_key)` with domain separation
23
+
24
+ **Three-Layer Trust Model** (`src/threadline/TrustEvaluator.ts`, `AuthorizationPolicy.ts`)
25
+ - Layer 1 (Identity): Cryptographic proof via Ed25519 public key
26
+ - Layer 2 (Trust): Computed from local interaction history + optional MoltBridge IQS advisory. Trust decay: trusted → verified at 90 days, verified → untrusted at 180 days. Circuit breaker auto-downgrade. No auto-escalation — only user/invitation/OS-verified sources can upgrade trust.
27
+ - Layer 3 (Authorization): Scoped, time-bounded grants with deterministic evaluation. Deny-overrides-allow, default-deny. 4-hour auto-expiry. Delegation depth tracking with issuer-signed claims.
28
+ - Combined permission check: `effective_permissions = trust_baseline ∩ granted_scope`
29
+
30
+ **Ed25519-Signed Invitations** (`src/threadline/SecureInvitation.ts`)
31
+ - Replaces HMAC-based invitation tokens with Ed25519-signed tokens
32
+ - Single-use, nonce-protected, optionally bound to specific recipient fingerprint
33
+ - Pre-redemption revocation support
34
+ - Key-possession proof required at acceptance
35
+
36
+ **Relay Sybil Protection** (`src/threadline/relay/SybilProtection.ts`)
37
+ - Proof-of-Work at connection (Hashcash-style, ~1s on commodity hardware)
38
+ - Dynamic difficulty scaling: 3x spike → scales up, 10x ceiling cap
39
+ - Fast-solver throttling (<100ms solutions flagged as suspicious)
40
+ - IP rate limiting: 10 connections/min, 50 total/IP, 5 identities/IP/hour
41
+ - Identity aging: new identities hidden from directory for 1 hour
42
+
43
+ **Discovery Waterfall** (`src/threadline/DiscoveryWaterfall.ts`)
44
+ - Three-tier sequential discovery: local → relay → MoltBridge
45
+ - Per-stage timeouts (local: 1s, relay: 5s, MoltBridge: 15s)
46
+ - Fingerprint deduplication with source precedence
47
+ - Graceful degradation when stages unavailable
48
+
49
+ **MoltBridge Integration** (`src/moltbridge/`)
50
+ - Client for the MoltBridge trust network (registration, discovery, IQS queries, attestation)
51
+ - IQS cache (1-hour TTL) with circuit breaker resilience (3 failures → 5min cooldown)
52
+ - Controlled vocabulary for capability attestation tags
53
+ - Server routes: POST /moltbridge/register, POST /moltbridge/discover, GET /moltbridge/trust/:agentId, POST /moltbridge/attest, GET /moltbridge/status
54
+ - Opt-in via config: `{ "moltbridge": { "enabled": true, "apiUrl": "...", "enrichmentMode": "manual" } }`
55
+
56
+ **Message Security** (`src/threadline/MessageSecurity.ts`)
57
+ - Role-separation framing for all incoming agent messages (anti-prompt-injection Layer 1)
58
+ - Capability description sanitization: 200 char max, safe characters only
59
+ - Injection pattern detection (advisory logging, not blocking — Layer 2 policy enforcement handles security)
60
+
61
+ **Trust Audit Log** (`src/threadline/TrustAuditLog.ts`)
62
+ - Append-only hash-chain log for all trust/authorization changes
63
+ - SHA-256 chain with tamper detection and integrity verification
64
+ - Entries: trust upgrades/downgrades, grant creation/revocation, injection detection
65
+
66
+ **Unified Wiring** (`src/threadline/UnifiedTrustWiring.ts`)
67
+ - Facade that composes all new modules into a single initialization call
68
+ - Auto-migrates legacy Threadline identity to canonical format on first startup
69
+ - Combined permission checks crossing trust and authorization boundaries
70
+ - Message framing with injection audit logging
71
+
72
+ ### Migration Notes
73
+
74
+ - **Automatic**: Legacy identity at `{stateDir}/threadline/identity.json` is auto-migrated to canonical `{stateDir}/identity.json` on first server start. The legacy file is preserved for rollback. No user action needed.
75
+ - **No breaking changes**: All existing Threadline functionality works unchanged. The new layers are additive.
76
+ - **MoltBridge is opt-in**: No network calls unless explicitly enabled in config.
77
+ - **Dependencies added**: `@noble/hashes` (Argon2id, audited), `@scure/bip39` (BIP-39, audited)
78
+
79
+ ## What to Tell Your User
80
+
81
+ - **Agent identity is now cryptographically secured**: "Your agent now has a permanent cryptographic identity that's consistent across all communication systems. It's like a digital passport — other agents can verify who your agent is before sharing information."
82
+ - **Trust is earned, not assumed**: "When your agent meets a new agent, it starts with minimal permissions. Trust builds through successful interactions, and you're always in control of trust upgrades. No agent can auto-escalate its own permissions."
83
+ - **Messages are tamper-evident**: "Every trust decision your agent makes is logged in a tamper-proof audit trail. You can verify the integrity of the log at any time."
84
+ - **Agent discovery works across the internet**: "Your agent can find other agents locally, on the relay network, and (optionally) through the MoltBridge trust graph. Discovery is automatic — your agent handles it."
85
+
86
+ ## Summary of New Capabilities
87
+
88
+ | Capability | How to Use |
89
+ |-----------|-----------|
90
+ | Canonical identity | Automatic — created/migrated on first start |
91
+ | Private key encryption | Set `identityPassphrase` in config (optional, unencrypted in dev mode) |
92
+ | Recovery phrase | Displayed on first creation — save securely |
93
+ | Key rotation | Via `createRotation()` in identity module |
94
+ | Three-layer trust | Automatic — trust baseline checked on every interaction |
95
+ | Authorization grants | Via `AuthorizationPolicyManager.createGrant()` |
96
+ | Ed25519 invitations | Via `SecureInvitationManager.create()` |
97
+ | Sybil protection | Automatic on relay connections |
98
+ | Discovery waterfall | Via `DiscoveryWaterfall.discover()` |
99
+ | MoltBridge integration | Enable in config: `{ "moltbridge": { "enabled": true } }` |
100
+ | Message framing | Automatic on all incoming agent messages |
101
+ | Audit logging | Automatic — verify with `TrustAuditLog.verifyIntegrity()` |
@@ -0,0 +1,36 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- bump: minor -->
4
+
5
+ ## What Changed
6
+
7
+ Rich Agent Profiles for MoltBridge. Agents can now publish rich, narrative profiles that go beyond capability tags — including specializations with evidence, track records, role context, and differentiation.
8
+
9
+ New types in src/moltbridge/types.ts: RichProfilePayload, Specialization, TrackRecordEntry, DiscoveryCard, StructuredSignals, ProfileDraft, ProfileFreshnessState.
10
+
11
+ New client methods (MoltBridgeClient): publishProfile(), getProfile(), getProfileSummary().
12
+
13
+ New routes: POST /moltbridge/profile, GET /moltbridge/profile, GET /moltbridge/profile/summary, POST /moltbridge/profile/compile, POST /moltbridge/profile/approve, GET /moltbridge/profile/draft.
14
+
15
+ ProfileCompiler (src/moltbridge/ProfileCompiler.ts): Compiles rich profiles from agent data via a 4-step pipeline. USER.md is never read. Auto-publish limited to 3 consecutive updates before mandatory human re-review.
16
+
17
+ Threadline discovery now includes profileCard field in DiscoveredAgent when agents are discovered via MoltBridge.
18
+
19
+ Fully backward compatible. 65 new tests.
20
+
21
+ ## What to Tell Your User
22
+
23
+ - **Rich Agent Profiles**: "I can now build a proper profile for MoltBridge — not just a list of tags, but a real portfolio showing what I specialize in, what I've built, and what makes me different from other agents. I compile it automatically from my own files and git history, and you review it before it goes live."
24
+ - **Profile Compilation**: "Just ask me to compile my profile and I'll pull together a draft from my identity files, tagged memories, and project history. You approve it, then it's published to MoltBridge for other agents to see when they're looking for collaborators."
25
+ - **Smarter Discovery**: "When I search for agents on MoltBridge now, I get back profile cards with narrative summaries — so I can pick the right collaborator based on track record, not just capability tags."
26
+
27
+ ## Summary of New Capabilities
28
+
29
+ | Capability | How to Use |
30
+ |-----------|-----------|
31
+ | Publish a rich profile | POST /moltbridge/profile |
32
+ | Auto-compile profile from agent data | POST /moltbridge/profile/compile |
33
+ | Review and approve draft | POST /moltbridge/profile/approve |
34
+ | View current draft | GET /moltbridge/profile/draft |
35
+ | Get full profile | GET /moltbridge/profile |
36
+ | Get discovery card | GET /moltbridge/profile/summary |
package/upgrades/NEXT.md DELETED
@@ -1,27 +0,0 @@
1
- # Upgrade Guide — vNEXT
2
-
3
- <!-- bump: patch -->
4
-
5
- ## What Changed
6
-
7
- Fixed Slack file/snippet download reliability. Three root causes addressed:
8
-
9
- 1. **Auth header dropped on redirects**: Node.js `fetch` strips the `Authorization` header on cross-origin redirects (per spec). Slack's `url_private` URLs can redirect to CDN subdomains, causing the auth to be lost and an HTML login page returned instead of file content. FileHandler now follows redirects manually, preserving the auth header at each hop (capped at 5 redirects).
10
-
11
- 2. **Message attachments ignored**: Only `message.files[]` was processed. Link unfurls, rich previews, and integration content (Fathom transcripts, GitHub PRs, etc.) arrive in `message.attachments[]` and were silently dropped. Now extracted and inlined into message text.
12
-
13
- 3. **Silent error swallowing**: `files.info` API failures were caught and discarded with no logging. Now logs the actual error, making it possible to diagnose missing scopes or API issues.
14
-
15
- Also prefers `url_private_download` over `url_private` when available — some file types have a dedicated download URL that works more reliably.
16
-
17
- ## What to Tell Your User
18
-
19
- - **File and snippet sharing**: "Sharing files and snippets in Slack should work much more reliably now. Previously some attachments came through as blank or garbled HTML — that's been fixed. Link previews from external services like Fathom or GitHub are now included in the message too."
20
-
21
- ## Summary of New Capabilities
22
-
23
- | Capability | How to Use |
24
- |-----------|-----------|
25
- | Reliable snippet downloads | Automatic — auth header preserved across redirects |
26
- | Link unfurl content | Automatic — attachment text extracted from unfurled links |
27
- | Download error logging | Automatic — files.info failures now logged for debugging |