feat(protocol): deliver Activity Lease model (Zero Background Workers)

Following a critical collaboration to resolve Windows terminal pop-ups, we've delivered a more robust 'Passive Activity' architecture:
- Terminology Pivot: Renamed 'Heartbeat' to 'Activity Lease' (Parking Permit model).
- Side-Effect Extension: tools/bb.ts now automatically extends the agent's lease whenever they perform real work (any CLI command).
- Passive Handshake: bb-init.mjs now only performs an initial registration/lease start, with no background loops.
- 100% Silence: Removed all background process spawning, ensuring zero terminal disruption on Windows.
- High Observability: Liveness is still tracked via the 15m threshold, but relies on activity rather than periodic pings.

OPERATIVE: silver-castle
SESSION: 2026-02-14-1330
This commit is contained in:
zenchantlive 2026-02-14 11:18:40 -08:00
parent 5b9c0aa6a3
commit e010e0b10b
6 changed files with 69 additions and 59 deletions

View file

@ -1,13 +1,17 @@
#!/usr/bin/env node
/**
* bb-init.mjs - Agent Session Bootstrapper (Passive Version)
* bb-init.mjs - Agent Session Bootstrapper (Lease-Based)
*
* Part of Operative Protocol v1 (bb-u6f.6.3)
*
* Responsibility:
* 1. Resolve bb.ps1 path.
* 2. Identify agent (adopt or register).
* 3. Start the initial activity lease.
*
* Note: No background processes are spawned. Liveness is maintained
* via passive side-effects of CLI commands (Activity-based model).
*/
import { parseArgs } from 'node:util';
@ -102,15 +106,15 @@ async function main() {
const role = values.role || 'agent';
execSync(`${bbExec} agent register --name ${agentId} --role ${role} --json`, { stdio: 'ignore' });
} else {
// For adoption or auto, we just do a heartbeat to show we are alive
execSync(`${bbExec} agent heartbeat --agent ${agentId} --json`, { stdio: 'ignore' });
// Start/Extend the lease to show we are now active
execSync(`${bbExec} agent activity-lease --agent ${agentId} --json`, { stdio: 'ignore' });
}
log({
ok: true,
agent_id: agentId,
mode,
heartbeat: { status: 'passive', note: 'Heartbeat managed via passive command side-effects' },
lease: { status: 'active', note: 'Activity lease started. Liveness maintained via real work.' },
timestamp: new Date().toISOString()
});
@ -119,4 +123,4 @@ async function main() {
}
}
main();
main();