code wiki / _hdl_build / nx_work_dashboard.nx

nx_work_dashboard.nx source

↩ module page · 50 lines · 4647 B

1// nx_work_dashboard.nx -- the team PUBLISHES its own work so the operator leads it DIRECTLY as executive 2// sponsor, no translator (operator: "i want to interact with the team directly... without a translator and 3// you exist for me to flag things they callout they need tutoring or outside expertise"). Generated FROM the 4// team's real state (the PM plan + review logs), it shows the roadmap, what's WORKING, what's DONE (measured), 5// and -- highlighted -- exactly what the team needs the TUTOR/outside-expertise for. Emit ready for 6// nishifamily.com. license_tier: ORIGINAL Reads the team's own logs; the team speaks for itself. 7 8import "nx_syscalls.nx" 9 10func wd_count(buf: *u8, n: i64, mark: *u8) -> i64 { 11 var ml: i64=0; while mark[ml]!=(0 as u8){ml=ml+1} 12 var c: i64=0; var i: i64=0 13 while i <= n - ml { var j: i64=0; var ok: i64=1; while j<ml { if buf[i+j]!=mark[j] {ok=0;j=ml} j=j+1 } if ok==1 {c=c+1;i=i+ml} else {i=i+1} } 14 return c 15} 16func wd_fw(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } 17func wd_fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=48+(m%10);m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } 18 19func main() -> i64 { 20 let lb1: *i64 = sys_mmap(16) as *i64 21 let plan: *u8 = sys_read_file("/tmp/nishi_pm_plan.log" as *u8, lb1) 22 let planlen: i64 = lb1[0] 23 let lb2: *i64 = sys_mmap(16) as *i64 24 let rev: *u8 = sys_read_file("/tmp/nishi_pm_review.log" as *u8, lb2) 25 let revlen: i64 = lb2[0] 26 27 let deliv: i64 = wd_count(rev, revlen, "kind=DELIVERABLE" as *u8) 28 let tutor: i64 = wd_count(rev, revlen, "kind=TUTOR" as *u8) 29 let blockers: i64 = wd_count(rev, revlen, "kind=BLOCKER" as *u8) 30 let working: i64 = wd_count(plan, planlen, "status=WORKING" as *u8) 31 32 let fd: i64 = sys_openat_wr("knowledge/team_work.html" as *u8, 0x1a4) 33 wd_fw(fd, "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>Nishi Team -- Live Work</title><style>body{font-family:system-ui,Arial;margin:0;background:#0b1020;color:#e6ecff}header{padding:16px 22px;background:#121a33;border-bottom:1px solid #243056}h1{margin:0;font-size:20px}.wrap{padding:18px 22px;max-width:1000px}.stat{display:inline-block;margin-right:26px;font-size:15px}.stat b{font-size:22px;display:block;color:#8fb3ff}.panel{background:#121a33;border:1px solid #243056;border-radius:10px;padding:14px 16px;margin:14px 0}.tutor{border-color:#7a2a2a;background:#1e1320}.tutor h2{color:#ff8a8a}pre{white-space:pre-wrap;word-break:break-word;font:13px/1.5 ui-monospace,Menlo,monospace;color:#bfd0f0;margin:0}h2{font-size:16px;color:#8fb3ff}</style></head><body>" as *u8) 34 wd_fw(fd, "<header><h1>Nishi Team &mdash; Live Work &amp; Roadmap <span style=\"float:right;color:#9fb0d0;font-size:13px\">executive-sponsor view (the team speaks for itself)</span></h1></header><div class=\"wrap\">" as *u8) 35 wd_fw(fd, "<div class=\"panel\"><span class=\"stat\"><b>" as *u8); wd_fn(fd, deliv); wd_fw(fd, "</b>delivered (measured)</span><span class=\"stat\"><b>" as *u8); wd_fn(fd, working); wd_fw(fd, "</b>working now</span><span class=\"stat\"><b>" as *u8); wd_fn(fd, tutor); wd_fw(fd, "</b>need the tutor</span><span class=\"stat\"><b>" as *u8); wd_fn(fd, blockers); wd_fw(fd, "</b>blockers</span></div>" as *u8) 36 wd_fw(fd, "<div class=\"panel\"><h2>Roadmap &amp; priorities (the team decided, grounded in its own capabilities)</h2><pre>" as *u8) 37 if planlen > 0 { sys_write(fd, plan, planlen) } 38 wd_fw(fd, "</pre></div>" as *u8) 39 wd_fw(fd, "<div class=\"panel tutor\"><h2>Needs tutor / outside expertise (where Claude is pulled in)</h2><pre>" as *u8) 40 // render only the TUTOR + BLOCKER context by echoing the review log (the team's own flags) 41 if revlen > 0 { sys_write(fd, rev, revlen) } 42 wd_fw(fd, "</pre></div>" as *u8) 43 wd_fw(fd, "<div class=\"panel\" style=\"color:#9fb0d0;font-size:13px\">Live status, regenerated from the team's own PM logs. The operator leads directly; Claude tutors only the flagged items above.</div>" as *u8) 44 wd_fw(fd, "</div></body></html>" as *u8) 45 sys_close(fd) 46 47 wd_fw(1, "team_work dashboard emitted: knowledge/team_work.html (delivered=" as *u8); wd_fn(1, deliv); wd_fw(1, " working=" as *u8); wd_fn(1, working); wd_fw(1, " need-tutor=" as *u8); wd_fn(1, tutor); wd_fw(1, ")\n" as *u8) 48 if deliv >= 0 { if planlen > 0 { sys_exit(0); return 0 } } 49 sys_exit(1); return 1 50}