Skip to content

reconcile: land nightshift's 26 diverged commits + bump dips pointer - #53

Open
miles-on-nightshift wants to merge 27 commits into
mainfrom
reconcile/nightshift-parent-main
Open

reconcile: land nightshift's 26 diverged commits + bump dips pointer#53
miles-on-nightshift wants to merge 27 commits into
mainfrom
reconcile/nightshift-parent-main

Conversation

@miles-on-nightshift

Copy link
Copy Markdown
Collaborator

What

The nightshift box's main had diverged: 26 ahead / 63 behind origin. This PR reconciles both directions via a merge and bumps the dips submodule pointer to the reconciled head (8522065, includes datacore-dips#5's 3 landed drafts).

The 26 local commits are real trapped work: nightshift batch-end output, "sync: land agent work trapped on this machine" files, ledger/fleet-sync fixes, and the wave-trader unit. All non-conflicting local content is preserved; origin's 63 commits are integrated.

Conflict resolution — origin adopted as canonical (7 files)

Origin (plur9) had already superseded this box's infra edits with more-evolved versions, so origin won every conflict:

File Why origin
git_fleet_sync.py Nuanced #48 fix — fails on conflicts, not on deliberately-held repos
install_datacore_path.py Fixes fallthrough to system dir (PermissionError on winston/plur-claw)
ledger/fold.py origin ledger.py is identical + already carries full DIP-0047 attests
ledger_attest.py Clearer $HOME doc
wave-trader.service Scrubbed path example (/home/<account>)
commands/wrap-up.md Canonical
research_orchestrator.py Line-consistency (but see flag below)

⚠️ Three judgment calls flagged for YOUR review

I defaulted these to origin but they encode real choices — flip any in review:

  1. wrap-up.md — local auto-added GTD tasks to inbox.org (:wrap_up_extracted: tag); origin uses propose-then-confirm. Behavioral/UX choice.
  2. research_orchestrator.py — local had a modern claude_agent_sdk async impl (budget cap, rate-limit handling); origin still shells out to the claude CLI via subprocess. Worth porting if you want the SDK path.
  3. ledger/fold.py — local set item.artifact_commit from payload; origin does not. Confirm origin handles artifact_commit elsewhere before relying on it.

All three are recoverable from this branch's first parent if you want the local version.

Result

After merge, the nightshift box fast-forwards to origin and the 26/63 divergence is gone. dips is already reconciled (fast-forwarded locally, at 8522065).

🤖 Generated with Claude Code

miles-on-nightshift and others added 27 commits August 15, 2026 05:40
Fixes #47. The template was posting a generic
"is this still active?" comment on all stale PRs including agent-authored
ones, which is self-addressed noise. Changes:
- Add reviews, headRefName, baseRefName, mergeable to gh pr list fields
- Step 6 now branches on author/state/mergeable instead of posting one template
- Agent-authored PRs: never nag self; file task or escalate with specifics
- External-author PRs: specific nudge only when ball is genuinely with them, deduped
- Null reviewDecision / UNKNOWN mergeable: skip and re-check next run

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Root cause of 2026-08-12 winston.jsonl chain fork (resolved in merge
221efd0): the log_ownership_guard's actors() trusted DATACORE_ACTOR
unconditionally. On the mac, DATACORE_ACTOR=winston was set during a
test, making the guard treat mac as authorized to write winston.jsonl.

Fix: when the infrastructure registry maps this host to specific
ledger_actors, that mapping is authoritative and DATACORE_ACTOR is
ignored for ownership checks. New machines without a registry entry
fall back to the prior behavior (DATACORE_ACTOR then hostname).

Also fix two pre-existing test failures caused by GIT_AUTHOR_EMAIL
being set in the environment, which overrode git -c user.email in
test repos and broke the author-filter in changed(). Strip
GIT_AUTHOR_* / GIT_COMMITTER_* from subprocess environments in:
- TestLogOwnershipGuardAuthorship (test_hooks.py)
- b3_ownership_guard (test_ledger_attacks2.py)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Step 7 was writing extracted tasks directly to next_actions.org,
bypassing GTD's single capture point. Fixed to capture to inbox.org
so tasks go through triage before becoming committed work.

/continue --save already targets inbox.org correctly.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Nightshift agents sometimes write report files to the root Data repo's
reports/ directory, which the pre-commit allowlist rejects (only .datacore/
and .github/ are permitted at root level). Reports belong in space repos.
Ignore /reports/ to prevent pre-commit failures until agents are updated
to write reports to the correct space.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Committed by git_fleet_sync. These changes were made by agents on this
host and never committed, so they existed on exactly one disk and were
invisible to every other agent.

Skipped as junk: 1 file(s).
Committed by git_fleet_sync. These changes were made by agents on this
host and never committed, so they existed on exactly one disk and were
invisible to every other agent.

Skipped as junk: 1 file(s).
CLAUDE_CODE_SESSION_ID is not set in hook process env — session_id is
only available in the stdin JSON payload. All four hook scripts now call
set_session_id() after reading stdin, which caches the value for the
process. session_state.py gains set_session_id() + _session_id_override
fallback in _get_session_id(). Without this, _state_file() always
returned None and the sessions/ directory stayed permanently empty.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…3 hook

industry_landscape_file default was pointing to a nonexistent path
(0-personal/notes/2-knowledge/industry-landscape.yaml). The actual
file is at 1-datafund/1-tracks/research/Industry landscape.md.

- module.yaml: correct default path and description (YAML → md)
- research_orchestrator.py: wire LANDSCAPE_FILE to _setting_path()
  and remove the "deliberately NOT wired" note comment
- CLAUDE.base.md, README.md, research-status.md: update docs
- hooks/pre-commit: fix python → python3 (python not on PATH)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
git_fleet_sync was exiting 0 even when pull conflicts occurred, causing
systemd to see success and never escalate. 87 failures over 14 days went
unnoticed as a result.

- Return 1 when any pull conflict or push/commit failure is detected
- Also surface FAILED statuses in a dedicated section
- Add "N repo(s) needing a human" to the summary line (mirrors the
  interactive ledger_transport.py output that already gets this right)

systemd's OnFailure= can now fire for real failures. Addresses items 1
and part of 3 from issue #48.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
#48 item 2)

Adds two pieces:
- fleet_sync_alert.sh: sends a Telegram message with the last 30 journal
  lines when fleet-sync exits non-zero. Reads TELEGRAM_BOT_TOKEN /
  TELEGRAM_CHAT_ID from the environment; degrades to a journalctl entry if
  credentials are absent.
- install_fleet_sync_timer.sh: generates datacore-fleet-sync-alert.service
  alongside the main service. OnFailure= wires them together so systemd
  fires the alert on any non-zero exit. EnvironmentFile=-/home/${USER}/config/nightshift.env
  loads credentials (the `-` makes it optional).

Together with c594873 (exit non-zero on conflict), the two-week silent-
failure window is closed: a conflict now both exits 1 AND pages the human.

Deployment: re-run install_fleet_sync_timer.sh on nightshift to install
the new unit files, then systemctl daemon-reload.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
wave-trader.service was crash-looping (2927 restarts, every 30s) on
`from datacore.ledger import attests` -> No module named 'datacore'.
The unit's Environment=PYTHONPATH only had the gateio dir; the datacore
package lives at .datacore/lib. Appended .datacore/lib so the DIP-0047
ledger import resolves.

Applied live in /etc/systemd/system/ and now tracked here as a <HOME>
template alongside the sibling units so a re-provision doesn't
reintroduce the crash loop.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The nightshift box's main was 26 ahead / 63 behind origin — real local
work (nightshift batch-end output, sync'd trapped agent files, ledger and
fleet-sync fixes, the wave-trader unit) that never converged with origin's
canonical line. This merge integrates both directions and bumps the dips
submodule pointer to the reconciled head (8522065, includes datacore-dips#5).

Conflict resolution — origin adopted as canonical for all 7 conflicted
files, since origin (plur9) had already superseded this box's infra edits
with more-evolved versions:
- git_fleet_sync.py      -> origin (nuanced #48 fix: fails on conflicts, not held repos)
- install_datacore_path.py-> origin (fixes fallthrough to system dir / PermissionError)
- ledger/fold.py         -> origin (origin ledger.py identical + has full DIP-0047 attests)
- ledger_attest.py       -> origin (clearer $HOME doc)
- wave-trader.service    -> origin (scrubbed path example)
- commands/wrap-up.md    -> origin (canonical)
- research_orchestrator.py-> origin (line-consistency)

FLAGGED for review (local had content origin lacks — dropped here, noted
for follow-up, not lost; recoverable from this branch's first parent):
- wrap-up.md: local auto-added GTD tasks to inbox.org (:wrap_up_extracted:);
  origin uses propose-then-confirm. Behavioral choice — yours to make.
- research_orchestrator.py: local had a modern claude_agent_sdk async impl
  (budget cap, rate-limit handling); origin still uses subprocess CLI.
  Worth porting if you want the SDK path.
- ledger/fold.py: local set item.artifact_commit from payload; origin does
  not. Confirm origin handles artifact_commit elsewhere before relying on it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant