nx_publisher.nx
buildroot/runtime/_hdl_build/nx_publisher.nx
about
dependencies 5 imports · 94 importers
diagram shows first 10 each side; +0 more imports, +84 more importers in the complete lists below.
imports: nx_syscalls.nxnx_connect.nxnx_framed_append.nxnx_sha256.nxnx_arbiter.nx
imported by: nx_activities_gate.nxnx_aid_federation_gate.nxnx_aid_gate.nxnx_brand_publish_submit.nxnx_ciq_submit.nxnx_clean_market_gate.nxnx_docpub_publish.nxnx_docpub_ship.nxnx_ecodesign_gate.nxnx_estate_gate.nxnx_food_menu_gate.nxnx_food_site_gate.nxnx_garden_gate.nxnx_hostop.nxnx_household_gate.nxnx_hub_deploy_bundle.nxnx_hub_publish.nxnx_hub_publish_bin.nxnx_hub_publish_hostctl.nxnx_impact_gate.nxnx_lineage_deep_gate.nxnx_lineage_gate.nxnx_link_auto_gate.nxnx_link_gate.nxnx_meet_publish.nxnx_mgmt_publish_bin.nxnx_ng_publish.nxnx_price_gate.nxnx_price_hist_gate.nxnx_produce_gate.nxnx_pub_approve_outward.nxnx_pub_audit_gate.nxnx_pub_audit_run.nxnx_pub_bluegreen_gate.nxnx_pub_bypass2_gate.nxnx_pub_bypass_gate.nxnx_pub_canary_gate.nxnx_pub_cd2_gate.nxnx_pub_daemon.nxnx_pub_daemon2_gate.nxnx_pub_daemon_gate.nxnx_pub_deploy_gate.nxnx_pub_dns_apply.nxnx_pub_dns_gate.nxnx_pub_drain_diag.nxnx_pub_exceed_gate.nxnx_pub_fin_handoff.nxnx_pub_gallery_handoff.nxnx_pub_game_e2e_gate.nxnx_pub_go_games.nxnx_pub_govern2_gate.nxnx_pub_governed_gate.nxnx_pub_hostop_e2e_gate.nxnx_pub_library_handoff.nxnx_pub_loop_gate.nxnx_pub_metrics_gate.nxnx_pub_nobypass_gate.nxnx_pub_obs_gate.nxnx_pub_pd_exceed_gate.nxnx_pub_policy_gate.nxnx_pub_promote_gate.nxnx_pub_q_gate.nxnx_pub_reader_handoff.nxnx_pub_receipt_loop.nxnx_pub_rel_gate.nxnx_pub_resilient_gate.nxnx_pub_rollout.nxnx_pub_search_handoff.nxnx_pub_selfheal_gate.nxnx_pub_serve.nxnx_pub_serve_gate.nxnx_pub_ship.nxnx_pub_ship_andelin.nxnx_pub_ship_meet.nxnx_pub_ship_meet_gate.nxnx_pub_ship_now.nxnx_pub_smoke_gate.nxnx_pub_submit.nxnx_pub_submit_gate.nxnx_pub_teacher_handoff.nxnx_pub_tls_serve.nxnx_pub_todos.nxnx_pub_vroom_emit_handoff.nxnx_pub_vroom_handoff.nxnx_pub_vroom_ship.nxnx_publish_account_admin.nxnx_publish_banner.nxnx_publish_opaque_login.nxnx_reorder_gate.nxnx_rewards_gate.nxnx_seedlib_gate.nxnx_stackaudit_submit.nxnx_swap_gate.nxnx_swap_reward_gate.nx
structs
| none |
consts
| 14 | const PUB_MAGIC_50000: i64 = 50000 |
| 15 | const PUB_MAGIC_4294967296: i64 = 4294967296 |
| 16 | const PUB_MAGIC_100000: i64 = 100000 |
| 17 | const PUB_MAGIC_1000000: i64 = 1000000 |
| 18 | const PUB_MAGIC_262144: i64 = 262144 |
| 19 | const PUB_MAGIC_4096: i64 = 4096 |
| 21 | const PUB_REC_CAP: i64 = 4096 |
functions
| 23 | func pub_queue_default() -> *u8 { return "knowledge/publish/queue.tsv" as *u8 } |
| 26 | func pub_init() -> i64 { let d: *u8 = "knowledge/publish" as *u8; __syscall(83, d as i64, 493, 0, 0, 0, 0); return 0 } |
| 28 | func pub_hexd(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v } // 0-9 then a-f |
| 31 | func pub_uw(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 } |
| 32 | func pub_unap() -> i64 { let ts: *i64 = sys_mmap(16) as *i64; ts[0] = 0; ts[1] = PUB_MAGIC_50000; __syscall(35, ts as i64, 0, 0, 0, 0, 0); return 0 } |
| 35 | func pub_sha_file(path: *u8, outhex: *u8) -> i64 called by 32: mainmainmainmainmainmain+26 calls 5: sys_mmapsys_read_filesha256_digestsys_munmappub_hexd |
| 54 | func pub_build_rec(rec: *u8, site: *u8, requester: *u8, hex: *u8, src: *u8, dest: *u8, policy: *u8) -> i64 |
| 69 | func pub_submit_to(qpath: *u8, src: *u8, dest: *u8, site: *u8, requester: *u8, policy: *u8) -> i64 |
| 80 | func pub_submit(src: *u8, dest: *u8, site: *u8, requester: *u8, policy: *u8) -> i64 |
| 88 | func pub_append_unlocked(qpath: *u8, src: *u8, dest: *u8, site: *u8, requester: *u8, policy: *u8) -> i64 called by 2: eg_torn_childpg_child calls 6: sys_mmappub_sha_filesys_openat_appendpub_uwpub_unapsys_close |
| 106 | func pub_ledger_default() -> *u8 { return "knowledge/publish/ledger.tsv" as *u8 } |
| 107 | func pub_nap_us(us: i64) -> i64 { let ts: *i64 = sys_mmap(16) as *i64; ts[0]=0; ts[1]=us*1000; __syscall(35, ts as i64, 0, 0, 0, 0, 0); return 0 } |
| 110 | func pub_streq(a: *u8, b: *u8) -> i64 |
| 117 | func pub_field(line: *u8, linelen: i64, idx: i64, out: *u8) -> i64 |
| 132 | func pub_led_has(ledpath: *u8, sha: *u8, dest: *u8) -> i64 |
| 156 | func pub_record_ledger(ledpath: *u8, sha: *u8, dest: *u8, site: *u8) -> i64 called by 12: hostop_record_applymainmainmainmainmain+6 calls 5: sys_mmapfa_catfa_catnsys_now_realtime_secfa_appendz |
| 172 | func pub_run(qpath: *u8, ledpath: *u8, lockres: *u8, locked: i64, racewin_us: i64) -> i64 called by 3: eg_pub_childlg_childmain calls 9: sys_mmapsys_read_filepub_fieldpub_streqfl_acquirepub_led_has+3 |
| 215 | func pub_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } called by 24: hostop_receivehostop_is_readyhostop_driftmainmainmain+18 calls 2: sys_openat_rdsys_close |
| 218 | func pub_copy(src: *u8, dst: *u8) -> i64 called by 12: mainmainmainmainmainpub_promote_atomic+6 calls 5: sys_mmapsys_read_filesys_openat_wrsys_writesys_close |
| 229 | func pub_sha_match(path: *u8, expect_hex: *u8) -> i64 called by 10: hostop_apply_verifiedhostop_fanouthostop_driftmainmainmain+4 calls 3: sys_mmappub_sha_filepub_streq |
| 237 | func pub_pcat(base: *u8, suffix: *u8, out: *u8) -> i64 |
| 243 | func pub_rename(old: *u8, neu: *u8) -> i64 { return __syscall(82, old as i64, neu as i64, 0, 0, 0, 0) } // x86_64 rename |
| 247 | func pub_promote_atomic(stage: *u8, live: *u8) -> i64 called by 5: hostop_applymainpub_deploypub_canary_rolloutpub_fanout calls 4: sys_mmappub_pcatpub_copypub_rename |
| 254 | func pub_backup_prev(live: *u8) -> i64 |
| 261 | func pub_rollback(live: *u8) -> i64 called by 4: hostop_host_rollbackmainmainpub_health_gate calls 5: sys_mmappub_pcatpub_existspub_copypub_rename |
| 277 | func pub_mkdirp(path: *u8) -> i64 |
| 285 | func pub_deploy(expect_sha: *u8, src: *u8, stagepath: *u8, livepath: *u8) -> i64 |
| 302 | func pub_substr(hay: *u8, haylen: i64, needle: *u8) -> i64 |
| 314 | func pub_file_has(path: *u8, needle: *u8) -> i64 |
| 321 | func pub_audit_file(path: *u8, allowlisted: i64) -> i64 |
| 331 | func pub_audit_file_strict(path: *u8, allowlisted: i64) -> i64 |
| 349 | func pub_forbidden_in(code: *u8, n: i64) -> i64 |
| 364 | func pub_audit_src_strict(path: *u8, allowlisted: i64) -> i64 |
| 391 | func pub_join(root: *u8, name: *u8, out: *u8) -> i64 called by 65: hostop_receivehostop_is_readyhostop_applyhostop_host_rollbackhostop_apply_verifiedhostop_fanout+59 calls 1: pub_pcat |
| 399 | func pub_publish_one(sha: *u8, src: *u8, dest: *u8, site: *u8, stageroot: *u8, liveroot: *u8, ledpath: *u8) -> i64 |
| 408 | func pub_run_full(qpath: *u8, ledpath: *u8, stageroot: *u8, liveroot: *u8, lockres: *u8) -> i64 called by 33: mainmainmainmainmainmain+27 calls 7: sys_mmapsys_read_filepub_fieldpub_streqfl_acquirepub_publish_one+1 |
| 448 | func pub_policy_allows(policy: *u8, sha: *u8, approval_dir: *u8) -> i64 called by 6: mainmainmainpub_run_governedpub_run_resilientpub_plan calls 4: pub_streqsys_mmappub_joinpub_exists |
| 455 | func pub_approve(sha: *u8, approval_dir: *u8) -> i64 |
| 464 | func pub_run_governed(qpath: *u8, ledpath: *u8, stageroot: *u8, liveroot: *u8, lockres: *u8, approval_dir: *u8) -> i64 called by 9: mainmainmainmainmainmain+3 calls 8: sys_mmapsys_read_filepub_fieldpub_streqpub_policy_allowsfl_acquire+2 |
| 515 | func pub_dlcat(rec: *u8, o: i64, s: *u8) -> i64 { var w: i64=o; var i: i64=0; while s[i]!=(0 as u8){rec[w]=s[i];w=w+1;i=i+1} return w } |
| 516 | func pub_dlnum(rec: *u8, o: i64, v: i64) -> i64 { var w: i64=o; var m: i64=v; if m==0{rec[w]=48 as u8;return w+1} let t:*u8=sys_mmap(24); var k:i64=0; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var j:i64=0; while j<k{rec[w]=t[k-1-j];w=w+1;j=j+1} return w } |
| 519 | func pub_dl_raw(dlpath: *u8, reason: *u8, detail: i64, line: *u8, ll: i64) -> i64 |
| 534 | func pub_run_resilient(qpath: *u8, ledpath: *u8, stageroot: *u8, liveroot: *u8, lockres: *u8, approval_dir: *u8, dlpath: *u8, outcounts: *i64) -> i64 |
| 600 | func pub_sh_cause(reason: *u8, sha: *u8, src: *u8, ledpath: *u8, dest: *u8) -> i64 |
| 610 | func pub_sh_cause_name(c: i64) -> *u8 { if c==1 { return "PUBLISHER-BUG" as *u8 } if c==2 { return "SRC-MISSING" as *u8 } if c==3 { return "ARTIFACT-CHANGED" as *u8 } if c==5 { return "ALREADY-LIVE" as *u8 } return "DEPLOY-ERROR" as *u8 } called by 1: pub_selfheal |
| 611 | func pub_sh_action(c: i64) -> *u8 { if c==1 { return "FLAG-ENGINEER" as *u8 } if c==2 { return "FLAG-OWNER-RESTAGE" as *u8 } if c==3 { return "FLAG-OWNER-RESUBMIT" as *u8 } if c==5 { return "PRUNE-STALE-DUP" as *u8 } return "RETRY-NEXT-PASS" as *u8 } called by 1: pub_selfheal |
| 619 | func pub_selfheal(dlpath: *u8, reportpath: *u8, requeue_path: *u8, resub_led: *u8, ledpath: *u8) -> i64 |
| 677 | func pub_nap_ms(ms: i64) -> i64 { let ts: *i64 = sys_mmap(16) as *i64; ts[0]=0; ts[1]=ms*PUB_MAGIC_1000000; __syscall(35, ts as i64, 0, 0, 0, 0, 0); return 0 } |
| 680 | func pub_hash_bytes(data: *u8, len: i64, outhex: *u8) -> i64 |
| 694 | func pub_body_off(resp: *u8, n: i64) -> i64 called by 1: pub_smoke |
| 704 | func pub_http_get(port: i64, path: *u8, resp: *u8, cap: i64) -> i64 called by 4: mainmainmainpub_smoke calls 9: sys_socketsys_mmapsys_setsockoptnx_connect_boundedfa_catsys_write+3 |
| 737 | func pub_smoke(port: i64, urlpath: *u8, expect_sha: *u8) -> i64 |
| 750 | func pub_health_gate(expect_sha: *u8, livepath: *u8, port: i64, urlpath: *u8) -> i64 |
| 758 | func pub_deploy_smoke(expect_sha: *u8, src: *u8, stagepath: *u8, livepath: *u8, port: i64, urlpath: *u8) -> i64 |
| 770 | func pub_count_ledger(ledpath: *u8) -> i64 |
| 782 | func pub_plan(qpath: *u8, ledpath: *u8, approval_dir: *u8, out: *i64) -> i64 called by 2: pub_dryrunpub_status calls 6: sys_mmapsys_read_filepub_fieldpub_streqpub_policy_allowspub_led_has |
| 812 | func pub_dryrun(qpath: *u8, ledpath: *u8, approval_dir: *u8, out: *i64) -> i64 |
| 817 | func pub_status(qpath: *u8, ledpath: *u8, approval_dir: *u8, out: *i64) -> i64 |
| 831 | func pub_audit_query(ledpath: *u8, dest: *u8, out_sha: *u8) -> i64 |
| 854 | func pub_query_count_site(ledpath: *u8, site: *u8) -> i64 |
| 873 | func pub_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v } |
| 877 | func pub_record_outcome(ledpath: *u8, sha: *u8, dest: *u8, site: *u8, outcome: *u8, ts: i64, lead: i64) -> i64 |
| 898 | func pub_dora(ledpath: *u8, out: *i64) -> i64 |
| 960 | func pub_notify(notifypath: *u8, kind: *u8, dest: *u8, sha: *u8) -> i64 |
| 973 | func pub_changelog(ledpath: *u8, out: *u8, cap: i64) -> i64 |
| 1004 | func pub_approvers_path(approval_dir: *u8, sha: *u8, out: *u8) -> i64 |
| 1010 | func pub_has_line(path: *u8, needle: *u8) -> i64 |
| 1030 | func pub_approve_quorum(approval_dir: *u8, sha: *u8, approver: *u8) -> i64 |
| 1038 | func pub_quorum_met(approval_dir: *u8, sha: *u8, need: i64) -> i64 |
| 1050 | func pub_frozen(freeze_path: *u8) -> i64 { return pub_exists(freeze_path) } calls 1: pub_exists |
| 1052 | func pub_schedule_allows(now: i64, win_start: i64, win_end: i64, freeze_path: *u8) -> i64 |
| 1064 | func pub_bg_cpath(slotroot: *u8, dest: *u8, color: *u8, out: *u8) -> i64 |
| 1072 | func pub_blue_green_stage(slotroot: *u8, dest: *u8, color: *u8, src: *u8, expect_sha: *u8) -> i64 |
| 1081 | func pub_blue_green_flip(slotroot: *u8, dest: *u8, color: *u8) -> i64 |
| 1096 | func pub_canary_rollout(expect_sha: *u8, src: *u8, slotroot: *u8, dest: *u8, urlbase: *u8, port: i64, cohort: i64) -> i64 called by 2: hostop_canarymain calls 6: sys_mmappub_bg_cpathpub_copypub_smokepub_joinpub_promote_atomic |
| 1119 | func pub_promote_chain(expect_sha: *u8, src: *u8, dest: *u8, roots: *i64, nroots: i64, stageroot: *u8) -> i64 |
| 1132 | func pub_fanout(expect_sha: *u8, src: *u8, dest: *u8, targets: *i64, ntargets: i64, stageroot: *u8) -> i64 |
| 1146 | func pub_flag_set(store: *u8, name: *u8, val: i64) -> i64 |
| 1153 | func pub_flag_get(store: *u8, name: *u8) -> i64 |
| 1177 | func pub_rolling(expect_sha: *u8, src: *u8, dest: *u8, targets: *i64, ntargets: i64, stageroot: *u8) -> i64 |
| 1190 | func pub_retain(livepath: *u8) -> i64 |
| 1198 | func pub_retry(succeed_at: i64, maxtries: i64, base_backoff_ms: i64) -> i64 |
| 1212 | func pub_submit_pri(qpath: *u8, src: *u8, dest: *u8, site: *u8, requester: *u8, policy: *u8, pri: i64) -> i64 |
| 1222 | func pub_priority_pick(qpath: *u8, out_dest: *u8) -> i64 |
| 1251 | func pub_lockgroup_res(site: *u8, out: *u8) -> i64 |
| 1259 | func pub_lockgroup_acquire(site: *u8) -> i64 |
| 1263 | func pub_lockgroup_release(fd: i64) -> i64 { return fl_release(fd) } |
| 1270 | func pub_dns_config(domain: *u8, host: *u8, port: i64, out: *u8) -> i64 |
| 1280 | func pub_dns_emit(domain: *u8, host: *u8, port: i64, path: *u8) -> i64 |
| 1293 | func pub_run_drain(qpath: *u8, ledpath: *u8, stageroot: *u8, liveroot: *u8, lockres: *u8, approval_dir: *u8, max_cycles: i64, sleep_ms: i64) -> i64 |
| 1311 | func pub_forbidden_call(code: *u8, n: i64) -> i64 |
| 1323 | func pub_audit_call_strict(path: *u8, allowlisted: i64) -> i64 |
| 1357 | func pub_daemon_heartbeat(hbpath: *u8) -> i64 called by 3: mainmainpub_daemon_serve calls 6: sys_now_realtime_secsys_mmapfa_catnsys_openat_wrsys_writesys_close |
| 1365 | func pub_daemon_hb_age(hbpath: *u8, now: i64) -> i64 |
| 1372 | func pub_daemon_watch_init(dirpath: *u8) -> i64 |
| 1379 | func pub_daemon_wait(infd: i64, timeout_ms: i64) -> i64 |
| 1389 | func pub_daemon_should_stop(stopflag: *u8) -> i64 { return pub_exists(stopflag) } |
| 1392 | func pub_daemon_serve(qpath: *u8, ledpath: *u8, stageroot: *u8, liveroot: *u8, lockres: *u8, approval: *u8, watchdir: *u8, hbpath: *u8, stopflag: *u8, max_cycles: i64, poll_ms: i64) -> i64 |