Skip to content

Commit 84c02f5

Browse files
committed
merge: dev2 → master — reset full-date (epoch fonte di verità, web+cloud) + bridge tick 3-sezioni + diario Capitano + Sentinella stabilizzazione
# Conflicts: # .launcher/sentinel-bridge.py
2 parents 4c7d2c7 + ca0c03c commit 84c02f5

25 files changed

Lines changed: 1091 additions & 366 deletions

File tree

.launcher/pacing-bridge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ def format_message(d: dict) -> str:
891891
extra = f" delta_usage={d['delta_usage']} team_kt={d.get('team_kt', '?')}"
892892
return f"[BRIDGE PACING] tick saltato reason={why}{extra}."
893893

894-
ts = d["now"].strftime("%H:%M UTC")
894+
ts = d["now"].strftime("%Y-%m-%d %H:%M UTC")
895895
usage_now = d["usage_now"]
896896
proj = d["proj"] if d["proj"] is not None else "?"
897897
reset_at = d["reset_at"] or "?"
@@ -906,7 +906,7 @@ def format_message(d: dict) -> str:
906906
)
907907
parts = [
908908
f"[BRIDGE PACING] {ts} window={eff_str} samples={d['n_samples']}",
909-
f"usage={usage_now}% reset_in={h_str} reset_at={reset_at}UTC "
909+
f"usage={usage_now}% reset_in={h_str} reset_at={reset_at} "
910910
f"(proj={proj}% — INFO, segnale secondario volatile: NON guida le "
911911
f"decisioni, usa vel_team vs vel_target)",
912912
f"vel_team={d['vel_team']:.2f}%/h",

.launcher/sentinel-bridge.py

Lines changed: 215 additions & 160 deletions
Large diffs are not rendered by default.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: captain-diary
3+
description: Daily handoff diary for the Captain. The Captain is restarted often (context-refresh, new work window, reboot) and otherwise loses the day's hard-won pacing lessons — repeating the same mistakes (e.g. 3 Scouts at once → an unbrakable spike → a 5h coast to repay the debt). Read the PREVIOUS day's notes at startup (handoff), and APPEND a one-line note whenever something significant happens during the day (a scaling decision, a spike, a kill, a lesson). One append-only file per day.
4+
allowed-tools: Bash(python3 /app/shared/skills/captain_diary.py *)
5+
---
6+
7+
# captain-diary — passaggio del testimone tra Capitani
8+
9+
Un file per giorno in `$JHT_HOME/logs/captain-diary-YYYY-MM-DD.md`, append-only.
10+
Serve a **non ripartire da zero ogni riavvio**: le lezioni di pacing di oggi
11+
passano al Capitano di domani.
12+
13+
## Al risveglio (SEMPRE, prima di lavorare)
14+
15+
Leggi le note del Capitano del giorno precedente:
16+
17+
```bash
18+
python3 /app/shared/skills/captain_diary.py handoff
19+
```
20+
21+
Stampa le note di **ieri** (o dell'ultimo giorno lavorato) + ciò che è già
22+
annotato **oggi**. Erediti le lezioni → **non rifare gli stessi errori**. Se non
23+
c'è nulla, sei il primo: inizia ad annotare.
24+
25+
## Durante il giorno — annota gli eventi SIGNIFICATIVI
26+
27+
Una riga, quando succede qualcosa da cui si impara. NON il diario di tutto:
28+
solo ciò che servirebbe al Capitano di domani.
29+
30+
```bash
31+
python3 /app/shared/skills/captain_diary.py add "20:05 — 3 Scout insieme: picco \
32+
infrenabile in 15 min, 5h di coast per ripagare il debito. Lezione: max 1 Scout \
33+
poi 30 min di osservazione (C-02)."
34+
```
35+
36+
Cosa vale la pena annotare:
37+
- decisioni di scaling che sono andate male (o bene) — quanti worker, che throttle, cosa è successo;
38+
- un picco non frenabile e come l'hai recuperato;
39+
- un kill e perché;
40+
- un pattern emerso (es. "lo Scout sul sito X consuma il doppio");
41+
- qualunque cosa che, se la sapessi domani, eviterebbe un errore.
42+
43+
## Rivedere solo oggi
44+
45+
```bash
46+
python3 /app/shared/skills/captain_diary.py today
47+
```
48+
49+
## Regola
50+
51+
- Il diario è il **testimone**: leggilo al boot, alimentalo durante il giorno.
52+
- Note **brevi e azionabili** (un fatto + la lezione), non un log verboso.
53+
- L'orario lo mette lo strumento: tu scrivi solo il fatto e la lezione.

agents/_skills/rate-budget/SKILL.de.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Typische Ausgabe:
2121
```
2222
=== Rate Budget — claude ===
2323
Usage: 53%
24-
Reset: 13:49 (in 2h 34m)
24+
Reset: tra 2h 34m (2026-04-24 15:49 CEST)
2525
Measured velocity:+0.39%/h (EMA)
2626
Target velocity: 11.38%/h (to close at 92% by reset)
2727
Reset projection: 56%
@@ -46,7 +46,7 @@ Typische Ausgabe:
4646

4747
```bash
4848
python3 /app/shared/skills/rate_budget.py status
49-
# → provider=claude usage=55% status=OK throttle=T0 reset=13:49 (in 2h 34m)
49+
# → provider=claude usage=55% status=OK throttle=0 reset_in=2h 34m (at 2026-04-24 15:49 CEST)
5050
```
5151

5252
Nützlich für schnelle Logs oder Prüfungen mitten in der Schleife.

agents/_skills/rate-budget/SKILL.es.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Salida típica:
2121
```
2222
=== Rate Budget — claude ===
2323
Usage: 53%
24-
Reset: 13:49 (in 2h 34m)
24+
Reset: tra 2h 34m (2026-04-24 15:49 CEST)
2525
Measured velocity:+0.39%/h (EMA)
2626
Target velocity: 11.38%/h (to close at 92% by reset)
2727
Reset projection: 56%
@@ -46,7 +46,7 @@ Salida típica:
4646

4747
```bash
4848
python3 /app/shared/skills/rate_budget.py status
49-
# → provider=claude usage=55% status=OK throttle=T0 reset=13:49 (in 2h 34m)
49+
# → provider=claude usage=55% status=OK throttle=0 reset_in=2h 34m (at 2026-04-24 15:49 CEST)
5050
```
5151

5252
Útil para logs rápidos o comprobaciones a mitad de bucle.

agents/_skills/rate-budget/SKILL.fr.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Sortie typique :
2121
```
2222
=== Rate Budget — claude ===
2323
Usage: 53%
24-
Reset: 13:49 (in 2h 34m)
24+
Reset: tra 2h 34m (2026-04-24 15:49 CEST)
2525
Measured velocity:+0.39%/h (EMA)
2626
Target velocity: 11.38%/h (to close at 92% by reset)
2727
Reset projection: 56%
@@ -46,7 +46,7 @@ Sortie typique :
4646

4747
```bash
4848
python3 /app/shared/skills/rate_budget.py status
49-
# → provider=claude usage=55% status=OK throttle=T0 reset=13:49 (in 2h 34m)
49+
# → provider=claude usage=55% status=OK throttle=0 reset_in=2h 34m (at 2026-04-24 15:49 CEST)
5050
```
5151

5252
Utile pour des logs rapides ou des vérifications en cours de boucle.

agents/_skills/rate-budget/SKILL.hu.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Tipikus kimenet:
2121
```
2222
=== Rate Budget — claude ===
2323
Usage: 53%
24-
Reset: 13:49 (in 2h 34m)
24+
Reset: tra 2h 34m (2026-04-24 15:49 CEST)
2525
Measured velocity:+0.39%/h (EMA)
2626
Target velocity: 11.38%/h (to close at 92% by reset)
2727
Reset projection: 56%
@@ -46,7 +46,7 @@ Tipikus kimenet:
4646

4747
```bash
4848
python3 /app/shared/skills/rate_budget.py status
49-
# → provider=claude usage=55% status=OK throttle=T0 reset=13:49 (in 2h 34m)
49+
# → provider=claude usage=55% status=OK throttle=0 reset_in=2h 34m (at 2026-04-24 15:49 CEST)
5050
```
5151

5252
Hasznos gyors logokhoz vagy ciklus közbeni ellenőrzésekhez.

agents/_skills/rate-budget/SKILL.it.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Output tipico:
2121
```
2222
=== Rate Budget — claude ===
2323
Usage: 53%
24-
Reset: 13:49 (in 2h 34m)
24+
Reset: tra 2h 34m (2026-04-24 15:49 CEST)
2525
Measured velocity:+0.39%/h (EMA)
2626
Target velocity: 11.38%/h (to close at 92% by reset)
2727
Reset projection: 56%
@@ -46,7 +46,7 @@ Output tipico:
4646

4747
```bash
4848
python3 /app/shared/skills/rate_budget.py status
49-
# → provider=claude usage=55% status=OK throttle=T0 reset=13:49 (in 2h 34m)
49+
# → provider=claude usage=55% status=OK throttle=0 reset_in=2h 34m (at 2026-04-24 15:49 CEST)
5050
```
5151

5252
Utile per log veloci o check a metà loop.

agents/_skills/rate-budget/SKILL.md

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,59 @@ allowed-tools: Bash(python3 *)
88

99
The monitoring bridge (`.launcher/sentinel-bridge.py`) polls the active provider every 1–10 min (dynamic — more often under pressure) and writes each sample to `/jht_home/logs/sentinel-data.jsonl`. This skill reads only the **latest sample** that's already been written — no extra provider call.
1010

11-
## At Captain startup
11+
## Primary: the SAME tick the Sentinella gets
1212

13-
Before spawning any agent, run:
13+
Run with no argument (or `tick`):
1414

1515
```bash
16-
python3 /app/shared/skills/rate_budget.py plan
16+
python3 /app/shared/skills/rate_budget.py tick
1717
```
1818

19-
Typical output:
19+
You get the **exact same message** the bridge sends to the Sentinella — the
20+
bridge renders it every tick into `logs/last-tick.txt` and this reads it back
21+
(zero provider calls, zero divergence). Three airy sections + a bridge hint:
22+
2023
```
21-
=== Rate Budget — claude ===
22-
Usage: 53%
23-
Reset: 13:49 (in 2h 34m)
24-
Measured velocity:+0.39%/h (EMA)
25-
Target velocity: 11.38%/h (to close at 92% by reset)
26-
Reset projection: 56%
27-
Status: OK
28-
Throttle: T0 full speed
29-
Host: cpu=4.7% ram=9.8% (OK)
30-
31-
Recommended policy: Spawn freely in parallel — keep normal pace.
32-
Margin to 92% target: 39%
33-
Last tick: 2026-04-24T10:23:18.705062+00:00
24+
── BRIDGE TICK · 12:45:03 · codex · ON ──
25+
26+
⏱ FINESTRA 5H
27+
usage 51% target 92% → chiusura 2026-06-30 16:45 CEST (tra 4h 00m)
28+
velocità 11.5 %/h · target 10.2 %/h [+12% sopra]
29+
→ ATTENZIONE · proj 97%
30+
31+
📅 OGGI (budget giornaliero)
32+
consumato 4.2% / budget 9.0% (cap 14.0%) ✅
33+
velocità 1.1 %/h · target 0.8 %/h [+38% sopra]
34+
35+
📆 SETTIMANA
36+
usato 16% · rimane 84% · reset 2026-07-07 05:00 CEST (tra 6g 16h)
37+
velocità 3.4 %/h · sostenibile 1.1 %/h [+209% sopra] ratio 3.09×
38+
SOPRA-PACE · debito +6pp · lockout ~58h
39+
40+
🧭 CONSIGLIO BRIDGE
41+
Sopra-pace: throttle-to-pace + STOP nuovi spawn finché rientri. ...
42+
src=bridge.
3443
```
3544

36-
**Captain interpretation** (usa `Measured velocity` vs `Target velocity` — NON `Reset projection`, che è INFO volatile):
37-
- `Throttle T0–T1` + `Measured velocity` ben sotto `Target velocity` (under-pace) → full spawn (Scout + Analyst + Scorer + Writer + Critic)
38-
- `Throttle T1–T2` + `Measured``Target` (on-pace) → reduced spawn (one instance per role)
39-
- `Throttle T2+` or `Measured velocity` sopra `Target velocity` (burning) → **no spawn**, wait for the bridge to clear the throttle
40-
- `Reset projection` è solo INFO (estrapolazione volatile a fine finestra) — non basare lo spawn su quello.
45+
**Read it like this — la velocità è IL segnale** (proj è solo INFO volatile):
46+
- ogni sezione ha **velocità attuale** (usage consumato / tempo trascorso) vs **target** (quanto manca / tempo che resta), stessa unità %/h. Lo scarto `[+X%/-X%]` è il giudizio.
47+
- **5h** = il soffitto del provider (lock a 100% prima del reset). **Oggi** = il budget del giorno. **Settimana** = budget + debito.
48+
- velocità **sotto** target su tutte → c'è margine → spawn graduale (C-02). Velocità **sopra** target → frena / non spawnare. Segui il `🧭 CONSIGLIO`, ma **decidi tu** (C-01).
4149

42-
**If output is `NO_DATA`:** the bridge hasn't polled yet. Wait 1–2 min and retry. Do not start the team without this signal — you risk saturating the rate-limit blind.
50+
**If output is `NO_DATA`:** the bridge hasn't written a tick yet (not started, or off-hours). Wait 1–2 min and retry.
4351

44-
## One-liner version (scriptable)
52+
## Other modes
4553

4654
```bash
47-
python3 /app/shared/skills/rate_budget.py status
48-
# → provider=claude usage=55% status=OK throttle=T0 reset=13:49 (in 2h 34m)
55+
python3 /app/shared/skills/rate_budget.py plan # scheda dettagliata (velocity EMA, host, policy)
56+
python3 /app/shared/skills/rate_budget.py status # one-liner scriptable
57+
python3 /app/shared/skills/rate_budget.py live # FORZA un fetch fresco al provider (costa) — solo per dubbi gravi
4958
```
5059

51-
Useful for quick logs or mid-loop checks.
60+
`status` one-liner:
61+
```
62+
# → provider=claude usage=55% status=OK throttle=0 reset_in=2h 34m (at 2026-04-24 15:49 CEST)
63+
```
5264

5365
## When NOT to use it
5466

agents/_skills/rate-budget/SKILL.pt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Saída típica:
2121
```
2222
=== Rate Budget — claude ===
2323
Usage: 53%
24-
Reset: 13:49 (in 2h 34m)
24+
Reset: tra 2h 34m (2026-04-24 15:49 CEST)
2525
Measured velocity:+0.39%/h (EMA)
2626
Target velocity: 11.38%/h (to close at 92% by reset)
2727
Reset projection: 56%
@@ -46,7 +46,7 @@ Saída típica:
4646

4747
```bash
4848
python3 /app/shared/skills/rate_budget.py status
49-
# → provider=claude usage=55% status=OK throttle=T0 reset=13:49 (in 2h 34m)
49+
# → provider=claude usage=55% status=OK throttle=0 reset_in=2h 34m (at 2026-04-24 15:49 CEST)
5050
```
5151

5252
Útil para logs rápidos ou verificações a meio do ciclo.

0 commit comments

Comments
 (0)