Commit Graph
86 Commits
Author SHA1 Message Date
weichen 7e5cf55311 Merge authoritative main into the task branch
ci / test-pg (pull_request) Successful in 1m25s
ci / test (pull_request) Successful in 3m21s
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=c6fefa3435dc5d9524fc35483f1d34fa1a6e0d59.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync

# Conflicts:
#	tests/test_svc.py
2026-10-12 11:15:11 +00:00
weichenandCursor 442251c35e Reset per-service runtime state in svc.sh env_config
Why: Batch update --all left SVC_PIDCHECK from the prior service in
memory, so pid_alive/reclaim_own_port misclassified the next service's
process as dead/foreign, deleted svc.pid, and failed start on a still-
occupied port (genui/rdm1/rdmcand after successful dev).

Evidence: make test-governance (SELF; receipt /tmp/svc-pidcheck-gov.json);
new test_batch_update_stops_second_service_despite_prior_pidcheck +
SVC_PIDCHECK ratchet in test_svc_precheck.

Impact: env_config clears SVC_PIDCHECK/EXEC/VERSION/SOURCE per service;
batch update correctly stops and restarts each agent. After merge:
restore genui/rdm1/rdmcand and move rdmcand to its own data dir.

Refs: .task/feature-svc-pidcheck-leak.md; complements #456 reclaim_own_port
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 09:25:33 +00:00
weichenandCursor 7c608b6afe Reclaim own port holders before agent start and install
Why: genui update cleared svc.pid without killing the process, then
overwrote the binary and failed start with a false "non-ours" port error.
Evidence: make test-governance (receipt /tmp/svc-reclaim-governance.json)
Impact: reclaim_own_port walks ss listener ancestry; stop/check_port/install
wire it; orphans matching pidcheck are stopped, foreign occupants still refused
Refs: fix/svc-reclaim-own-port

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 08:57:04 +00:00
weichenandCursor 6056838b48 Fix static fresh-start pidcheck so health loop stays alive
Why: write_static_reg omitted pidcheck and pid_alive ignored in-memory
SVC_PIDCHECK, so first-boot curl probes fell back to agent-system and
misread python http.server as exited.
Evidence: python3 -m unittest tests.test_svc -v (17/17, new static case)
Impact: Static --dir deploy survives the pre-record_state health loop.
Refs: fix/svc-static-pidcheck-fresh-start

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 08:35:44 +00:00
weichenandCursor 1032bb4bc9 Require RDM companion UI and source-switch gate in svc.sh
Why: RDM agent deploy left workbench htdocs unserved (prompt-only), so
environments like dev silently offered API-only 404 pages after a source
switch; static first-start also misclassified http.server as dead when
pidcheck was unset.
Evidence: CMD="make test-governance" make evidence (200 ok, 1 skipped; SELF).
Impact: rdm deploy auto-starts <name>web and asserts UI 200; cross-kind
redeploy needs --allow-source-switch; list/info flag missing workbench.
Refs: .task/feature-svc-rdm-ui-gate.md; docs/svc.md §5.4

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 08:00:35 +00:00
weichen 66155d3feb Merge authoritative main into the task branch
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=b008bd94ad0fe6f520a8500f40ed6297251762b7.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
2026-10-12 06:07:02 +00:00
weichen b008bd94ad Merge pull request 'Gate the rdm audit entry on command availability (frontend pin + plain-base e2e)' (#418) from feature/rdm-audit-capability-gate into main
ci / test-pg (push) Successful in 2m9s
ci / test (push) Successful in 3m41s
Reviewed-on: https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/418
2026-10-12 06:04:40 +00:00
weichen ee7903344f Merge authoritative main into the task branch
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=673e687c5c85b9af3ce13ca30845d5e68de5dfa0.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
2026-10-12 05:27:29 +00:00
weichen 904a8351c7 Merge authoritative main into the task branch
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=b431777c9fa9c74f096d7f14fce40d1beba53fe2.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
2026-10-12 05:06:11 +00:00
weichenandCursor 4713d5953c Merge origin/main into U1 account-binding; keep user+backup actions
Why: Dev #429 conflicted on scripts/svc.sh (U1 user vs main backup) and Backend gitlink.
Evidence: conflict hunks resolved; actions include init|user|backup|backups
Impact: PR #429 should become mergeable after push; both U1 binding and agent backup entrypoints preserved.
Refs: Dev pulls/429; main backup #417; Backend #171
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 05:06:09 +00:00
weichenandCursor 2a03dd58f9 Bind svc user CLI to instance storage and reject lock bypass
Why: U1 requires account ops to hit manifest data_root/DSN with OpenExisting and refuse missing flock or default ./data.
Evidence: python3 -m unittest tests.test_svc_user_binding (T1–T5) + test_svc_identity
Impact: svc <env> user … calls ENV_BIN with --open-existing; deploy/user fail closed without flock.
Refs: docs/svc-deploy/u1-instance-account-binding.md; Backend OpenExisting (PR #171)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 03:55:24 +00:00
weichenandCursor feccf26b90 Wire U1 I3 DB identity into svc start and tests
Why: after #415 file markers, startup must also bind
manifest.instance_id to agent_system_identity (I4).
Evidence: python3 -m unittest tests.test_svc_identity
tests.test_svc_recover (OK, 1 skipped NOT_RUN for real PG);
Backend pin b92eaca (PR #170).
Impact: svc ensure/verify + AGENT_SYSTEM_* env; stub identity;
I3 SQLite tests; design doc status; modules/backend gitlink.
Refs: docs/recovery/u1-identity-manifest.md §5.2; Backend #170

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 03:52:48 +00:00
weichen d02f3a1f14 Bump frontend pin: password form semantics and typed setting inputs
Why: increment 3 of the 2026-10-12 diagnostic - the change-password modal
lacked form semantics (no form/autocomplete/username association) and
SettingInput masked all free-text config values.

Evidence: frontend 8db7093 (vitest 24 files / 116 tests incl.
settingInputAttrs matrix; knip; tsc -b && vite build); full e2e and make
test receipts follow on this head.

Impact: modules/frontend pin follows; e2e.sh phase 4 also runs the new
changepw-form spec; task card records scope, authorization and stages.

Refs: 2026-10-12 diagnostic report, increment 3; stacked on PR #418.
2026-10-12 03:49:00 +00:00
weichen 67da726e7f Merge authoritative main into the task branch
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=af9c2de663be5ff102dcab7698464a645832f569.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
2026-10-12 03:29:59 +00:00
weichen 34028789c5 Merge authoritative main into the gating task branch
Why: task-sync ahead of review; main advanced via #414/#415 (admin-zone
hosting, U1 instance identity).

Evidence: frontend merge verified (vitest/knip/build); dev-level make test
and e2e rerun on this head follow as evidence receipts.

Impact: resolves the modules/frontend gitlink to the component merge head.

Refs: parent evidence in this task card.
2026-10-12 03:28:31 +00:00
weichen 3ca4f3bc35 Add svc.sh agent data-dir snapshots with SQLite-consistent backup
Why: the 2026-10-11 runtime/ deletion lost all agent SQLite data with no
backup; the svc-autorecover closing report left "agent SQLite backup" as
a follow-up and the user asked to land it (recovery plan U2 residue).
Evidence: tests/test_svc_backup.py 11/11 green locally (live WAL writer,
manifest sha, retention, guards); make test-governance full suite green
(159 tests, rerun twice after one unreproduced flake).
Impact: new service-level actions backup/backups; snapshots live in
runtime-backups/<name>/ outside runtime/; rm --purge removes them; pg
backup and other flows unchanged.
Refs: modules/documents/docs/proposals/2026-10-12-service-restart-data-recovery.md r2 (sec 6, U2 residue); task card .task/feature-svc-agent-backup.md.
2026-10-12 03:06:04 +00:00
weichen c0799b69c2 Bump frontend pin: plain-base spec gated to its own e2e phase
Why: the plain-base scenario must not run in the phase-3 RDM-combo sweep.

Evidence: frontend 986ebdb self-skips unless E2E_PLAIN_BASE=1 (phase-3 rerun
showed 4 rdm-audit tests passing); full e2e rerun follows this commit.

Impact: modules/frontend pin e058adc -> 986ebdb; e2e.sh phase 4 injects
E2E_PLAIN_BASE=1.

Refs: 2026-10-12 diagnostic report, increment 2.
2026-10-12 03:02:18 +00:00
weichen 6cf65f6357 Bump frontend pin: gate audit entry on command availability
Why: the rdm-audit entry must hide on plain bases lacking rdm.inspect.*
commands (2026-10-12 diagnostic, increment 2), and the dev-repo e2e driver
needs a plain-base phase to prove it end to end.

Evidence: frontend e058adc carries the gating (vitest 23 files / 112 tests
incl. new contract matrix; tsc -b && vite build pass); full e2e rerun
follows this commit (RDM combo + plain base phases).

Impact: modules/frontend pin 360d640 -> e058adc; scripts/e2e.sh gains
phase 4 (same $DATA served by the base CLI, plain-base.playwright.ts);
task card records scope, authorization chain and stage table.

Refs: 2026-10-12 diagnostic report, increment 2.
2026-10-12 02:59:46 +00:00
weichen c170939bb7 Implement the U1 identity manifest layer with startup verification and tests
Why: approved design (2026-10-12) - persistent manifest becomes the startup authority, closing the param-rebuild drift, non-atomic per-key writes, and missing-config-creates-empty-system recovery gaps (plan r2 U1 / KTD1-KTD2).

Evidence: SELF - python3 tests/test_svc_identity.py 21 tests OK (1 skip = real-PG identity NOT_RUN by design); make test-governance 169 OK incl. existing svc db-binding and autorecover suites; receipts appended via make evidence.

Impact: scripts/svc.sh gains manifest-aware set/del/record_state/autostart plus lock-held migrate, pre-launch identity verify and an init action; new scripts/svc_manifest.py (atomic temp-fsync-rename, identity anchors, derived svc.env); unmigrated instances keep the exact legacy path (regressions green).

Refs: docs/recovery/u1-identity-manifest.md; plan r2 section 7 U1
2026-10-12 02:50:32 +00:00
weichen 5e9083cff4 Keep recovered services alive when the watchdog oneshot exits
ci / test-pg (pull_request) Successful in 1m1s
ci / test (pull_request) Successful in 2m34s
Why: systemd's default KillMode=control-group kills every process in
the unit's cgroup when the oneshot finishes -- the daemon recover just
started died seconds after the recover ok event (observed live on the
host: revived at 22:13:40, gone by 22:13:42).

Evidence: unit text now carries KillMode=process (asserted in
test_watchdog_print_plan); suite 10/10 and make test-governance rerun
recorded on the card; live re-demo on the host after merge.

Impact: scripts/svc.sh wd_service_text only.

Refs: .task/feature-svc-autorecover.md
2026-10-11 22:15:31 +00:00
weichen c514bc4f4d Merge authoritative main into the task branch
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=3de5791e0841e9c7c40c3dc236be6d95b3969827.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
2026-10-11 21:56:13 +00:00
weichen e08ceebb95 Guard start paths with the ss-free port probe too
ci / test-pg (pull_request) Successful in 1m1s
ci / test (pull_request) Successful in 2m34s
Why: check_port_free consulted port_owner (ss -ltnp) only, so the
/dev/tcp fallback added to port_listening never ran on the start path;
CI (no iproute2) still started onto a thief-held port.

Evidence: no-ss simulation refuses a bound port and passes a free one;
full suite 10/10 and make test-governance rerun recorded on the card;
CI on the new head is authoritative.

Impact: scripts/svc.sh check_port_free only.

Refs: .task/feature-svc-autorecover.md
2026-10-11 21:34:12 +00:00
weichen 9b5ecd57a2 Detect listening ports without ss via /dev/tcp fallback
ci / test-pg (pull_request) Successful in 1m0s
ci / test (pull_request) Failing after 1m6s
Why: the CI runner container has no iproute2, so port_listening went
blind: recover started a service onto a thief-held port and the health
probe hit the thief (HTTP 200), reporting a bogus start success.

Evidence: no-ss PATH simulation shows the fallback detects a bound port
and passes free ports; make test-governance rerun recorded on the task
card; CI on the new head is authoritative.

Impact: scripts/svc.sh port_listening only (ss stays primary when
present).

Refs: .task/feature-svc-autorecover.md
2026-10-11 21:12:16 +00:00
weichen 419380187d Add an rdm deploy source to svc (downstream composite binary)
Why: RDM capabilities (two-trees-one-net, rdm.* trace-audit command face)
only exist in the downstream Agent-System-RDM composite binary; svc's three
existing sources all produce the Dev binary, so none of it could be deployed
or lifecycle-managed. This adds --from rdm[@<sha>] with the same isolated
source-repo semantics as the dev source.

Evidence: make test-governance 138/138 (two new stub cases: deploy E2E and
commits/update track); real deployment rdm@2aef3fc recorded in the task card
(pins materialized, pure-Go build, web workbench to htdocs, serve health OK,
rdm.ping/rdm.inspect.capabilities committed, update --check reports latest);
make test full suite exit=0. All segments written by make evidence.

Impact: scripts/svc.sh (rdm source resolution/materialization/deploy/update/
commits, probe timeouts, rdm seed skip, ELF env-DSN evidence fallback),
docs/svc.md 5.4, tests/test_svc.py. RDM-side CLI alignment landed as RDM
PR #228; no base submodules touched.

Refs: task card .task/feature-svc-rdm-source.md; RDM PR #228/#229.
2026-10-11 20:46:03 +00:00
weichen 59109e589c Merge authoritative main into the task branch
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=acc8bf124c04b89ed05093467ebce865934bdddc.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
2026-10-11 20:21:43 +00:00
weichen eda942523c Add svc auto-recovery: autostart desired-state, recover, watchdog
Why: svc services are bare nohup'd processes with persisted registration
but no supervision -- a crash, an OOM kill, or a reboot left them dead
until manual restart (2026-10-11 outage: dev service lost, runtime/ also
wiped by hand, nothing brought services back).

Evidence: tests/test_svc_recover.py 10 cases green (start records
autostart, stop clears it incl. dead-process stop, SIGKILL then recover
revives with persisted exec=, lock-held skips, port-stolen fails with
recover fail event, watchdog unit text via --print); make test-governance
146/146 OK locally; real-machine watchdog install + kill -9 revival to be
recorded on the task card.

Impact: svc.sh gains autostart key in svc.env, `recover [name]
[--quiet]` (postgres-first, per-service .start.lock, recover history
events), `watchdog install|remove|status` (systemd user timer, cron
fallback hint), lifecycle lock across start/stop/restart/deploy/update;
spawned services no longer inherit the lock fd (9>&-), and lock release
no longer clobbers script stderr. Makefile adds svc-recover/svc-watchdog;
docs/svc.md documents semantics and boundaries.

Refs: task card .task/feature-svc-autorecover.md; docs/svc.md 6.5/6.6;
parallel planning card feature/service-restart-recovery-plan (same
problem space, plan-stage).
2026-10-11 20:20:27 +00:00
weichen e67f026827 Build the seeding CLI from the RDM-pinned backend
Why: task-sync advanced the Dev backend gitlink past the RDM pin; a newer-schema user-create CLI migrates the fresh store beyond what the RDM binary (schema ceiling of its pin) can open.

Evidence: reproduce on 20261011-180439 run (v25 store vs v24 binary); rerun green recorded after this change.

Impact: scripts/e2e.sh only; seeding and serving now share one base version.
2026-10-11 18:05:30 +00:00
weichen 46e5e3a477 Build the RDM E2E binary offline from local objects
Why: git submodule clone over the flaky Gitea SSH endpoint hangs the whole run; local archive + pinned-checkout snapshot removes the network dependency and cuts the build stage to seconds.

Evidence: this exact tree ran scripts/e2e.sh to green (4 passed) twice, recorded in the task card.

Impact: scripts/e2e.sh only; behavior unchanged when the network is healthy.
2026-10-11 18:02:53 +00:00
weichen fbd583fc65 Add E2E launcher for U4 audit acceptance and bump frontend pin
Why: U4 acceptance needs a reproducible real-browser run: build the
RDM binary from its origin/main, seed projects/ingest via the command
API, serve with auth on, and drive Playwright against vite preview.

Evidence: scripts/e2e.sh --seed-only smoke (in progress this task);
frontend pin points at the Playwright harness commit.

Impact: dev tooling only (.tmp artifacts ignored; no runtime changes).

Refs: task feature/rdm-e2e-acceptance; frontend feature branch of
the same name.
2026-10-11 17:58:12 +00:00
weichen 4b98e25687 Seed settings with an auto-minted temporary key when auth is on
Why: seed_settings PUTs /api/settings/user without credentials, so under the PG tier's always-on auth the seed always 401s and model config silently never lands (reproduced on the dev instance 2026-10-11; settings had to be written by hand).
Evidence: make test-governance && make test exit=0 (receipt 8ffc3a89); tests/test_svc.py adds three stub-based cases - auth-on seeds with a Bearer header and create/revoke around the PUT, --seed-owner skips account lookup, auth-off stays credential-free; 14/14 svc tests green.
Impact: deployments that pass SVC_MODEL_*/SVC_TAVILY_KEYS now seed reliably regardless of auth mode; a temporary apikey (name=svc-seed) is minted for the first admin (or --seed-owner/SVC_SEED_OWNER) and revoked right after; auth-off path unchanged.
Refs: task card feature-svc-seed-auth.
2026-10-11 14:58:36 +00:00
weichen 6e4ebae2f6 Merge origin/main: supersede the PR #317 minimal fix with the unified resolver
Why: main landed fix-svc-dsn-reuse-dbref (reuse-path dbref restore, env-DSN
aware precheck, DSN_ENV scoping) for the same restart-DSN incident; the
approved recovery plan is its superset and replaces those mechanisms with
resolve_db_config + recoverable svc.env keys + refuse-on-invalid semantics.
Evidence: tests/test_svc_precheck.py ported to the new units (18 cases green,
same scenario matrix; broken-dbref expectation updated to refusal per the
approved plan); tests/test_svc.py 11 cases green; bash -n OK.
Impact: conflict hunks resolved toward the unified resolver; main's source
guard at the script tail restored; agent_listen_rejected kept as a pure
predicate (used by the start precheck and the governance tests).
Refs: main 7acf318 (PR #317); task card .task/feature-svc-db-config-recover.md.
2026-10-11 09:21:27 +00:00
weichen 3b8fef7fad Recover svc.sh database config across restarts and refuse on invalid binding
Why: the exec= reuse path stripped --dsn into the process environment (G1-7)
and record_state then persisted a DSN-less exec=, while the dbref fallback only
existed in the explicit-rebuild branch - the second bare restart after a
rebind silently dropped the database (SQLite fallback on loopback). Auth
preflight also matched --dsn on the command line only, so env-delivered DSN
with auth=auto was misjudged as unauthenticated.
Evidence: bash -n OK; make test-governance 115 tests OK (new tests/test_svc.py
11 cases; 10/11 fail against the pre-fix script); make test green; make build
OK; isolated real PostgreSQL 18.6 + real binary validation 27/27 (consecutive
restarts/deploy keep binding, psql-verified database identity, DB-down restart
fails without SQLite fallback or config loss, no credential leakage) - all
recorded via make evidence in the task card.
Impact: svc.env gains db=/dbref=/dsn= recovery keys (atomic 0600 writes);
start/restart/deploy/update/db share one resolver; invalid bindings, config
conflicts, mock coexistence and env-DSN-incapable binaries now refuse to
start instead of silently downgrading; legacy exec= DSN migrates idempotently;
docs/svc.md and script help updated.
Refs: task card .task/feature-svc-db-config-recover.md; user-approved plan
(2026-10-11 session message); AGENTS.md evidence gates.
2026-10-11 09:16:54 +00:00
weichen 7acf3186ca Align the svc.sh startup precheck with the binary auth semantics and keep the reused DSN
Why: G1-7 moved the DSN into AGENT_SYSTEM_DSN, but the precheck only read
the arg string, so a non-loopback restart with auth auto was wrongly
rejected (2026-10-10 dev incident); the reuse path no longer restored the
dbref-bound DSN and would silently fall back to SQLite; and DSN_ENV leaked
across same-process starts (update --all) into other services' env.
Evidence: tests/test_svc_precheck.py 19 cases green (auth matrix vs
config.go AuthEnabled, reuse migration/dbref restore, scope isolation);
full governance suite 123 green; incident-scenario replay allowed + DSN
carried. Recorded via make evidence.
Impact: scripts/svc.sh precheck and reuse-start DSN handling only; no
binary change, no persistence-format change.
Refs: .task/fix-svc-dsn-reuse-dbref.md; config.go AuthEnabled (on || (not
off && DSN non-empty), env DSN counts).
2026-10-11 02:10:21 +00:00
weichen a6d434e432 Pass the PG DSN via environment instead of the command line (G1-7)
ci / test (pull_request) Successful in 2m18s
Why: the plan section 3.4 observed the local dev service carrying the
credential-bearing DSN as a serve --dsn argument, visible to any
process on the host (ps / /proc/<pid>/cmdline) — including scripts
generated by agents. The base config layer already supports
AGENT_SYSTEM_DSN, so the launcher can move the secret out of the
argument vector without touching the binary.

Evidence: bash -n clean; make test-governance 104/104 green; an
end-to-end probe with a stub binary and a legacy exec= carrying
--dsn ...secret... shows the migration stripping the flag
(MIGRATED:yes), the process args free of the secret
(NO-LEAK-IN-CMDLINE), and AGENT_SYSTEM_DSN present in the process
environment (DSN_IN_ENV:yes). New/rebuilt launches never put the DSN
in argv; legacy persisted configs are migrated on first reuse.

Impact: scripts/svc.sh only — rebuild path sets DSN_ENV instead of
--dsn, reuse path strips --dsn from stored exec= once and logs the
migration, launch injects AGENT_SYSTEM_DSN alongside the existing
guard vars. CLI --dsn still wins inside the binary (config
precedence), so manual invocations are unchanged.

Refs: plan G1-7 (line 356) and section 3.4 (2026-10-09 ps
observation); backend config AGENT_SYSTEM_DSN.
2026-10-10 02:39:19 +00:00
weichen 761c2954dc Merge authoritative main into the task branch
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=878e0e7ceba3bb6b78c36c5113eacc846a7f017b.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
2026-10-07 12:35:08 +00:00
weichen 2806371b52 Take the backend intent slow lane and the I2 port pins (I2 WP3)
Why: backend #83 merged the slow-lane wiring (intentsem scorer/
generator, gate SetSemantic/SetGenerator, settings flags default off);
the Dev pins and boundary rules must move with it.
Evidence: backend CI green on 9d29371; check-pins consistent
(agent-intent 343b1e6 across Dev and the backend nested copy);
lint-boundaries registers intentsem as an agent-intent adapter and the
architecture baseline gains backend/app->backend/intentsem.
Impact: product behavior unchanged by default; the two
runtime.intent* flags opt into the slow lane.
Refs: Agent-System-Backend#83, I2 increment 3
2026-10-07 11:34:52 +00:00
weichen 908504e8b5 Connect long-term plans to task completion
Why: preserve project direction across tasks and require grounded next-task recommendations.

Evidence: the generated task-card regression fails before the template update and passes afterward; original SELF receipts are in the task card.

Impact: document the planning entrypoint and extend task records without granting new-task execution rights.

Refs: .task/feature-goal-continuity.md; policy/delivery.md
2026-10-07 06:10:51 +00:00
weichen 14c55def98 Preserve delivery references after task archival
Why: archived task cards change directory and must retain an unambiguous policy reference.

Evidence: review finding 1, focused red-green proof and 104 passing governance tests are preserved in the task card.

Impact: use a repository-root text reference; record the completed review and its resolved finding.

Refs: .task/feature-iterative-delivery.md; .task/reviews/iterative-delivery.json
2026-10-07 03:10:09 +00:00
weichen 1ac79c2a90 Define iterative delivery with explicit stage reviews
Why: make requirements, experiments and implementation revisions reviewable while retaining bounded continuous authorization.

Evidence: task-card SELF receipts include expected red regressions and 104 passing governance checks; full candidate verification follows.

Impact: add project delivery policy and generated task fields; make post-merge reminders read-only.

Refs: .task/feature-iterative-delivery.md; policy/delivery.md
2026-10-07 02:53:20 +00:00
weichen a5f0ca107d Only count remote-unreachable commits as local work in finish guard
ci / test (pull_request) Successful in 2m19s
Why: 本地 main 停在 origin/main 顶端(克隆默认态)在 pin 为 feature 顶端时不在 pin
历史内,--branches 直判仍会误阻(本 worktree 自身收尾实测踩到)。
Evidence: 第五例回归(本地默认分支+克隆 reflog 不阻)全绿;五例套件+全套治理回归
GOVERNANCE-SUITE-OK;worktree 实际 finish 通过即端到端自证。
Impact: local_work_outside 候选提交先过 --not --remotes 过滤(远端可达即已保全);
stash 仍恒算本地独有。
2026-10-05 15:05:54 +00:00
weichen 91d25a3ed1 Fix two finish-guard false positives: IDE locks and remote-only refs
ci / test (pull_request) Successful in 2m21s
Why: 2026-10-05 两次实测踩到——①rglob("*.lock") 把 .git/cursor/ IDE 产物当 Git 锁
(五天陈锁阻断 worktree 回收);②pinned-history 用 --all --reflog 把 refs/remotes
计入,pin 在 feature 顶端的子仓永远无法 finish(被迫删远端引用+清 reflog 损害现场)。
Evidence: FinishGuardFixTests 四例全绿(误报修复+真实锁仍拦+独有提交仍保);
全套治理回归 91 例 OK;make test 全链证据入卡。
Impact: 仅 finish 模式两处判定;IDE 产物与远端引用不再误伤,本地独有工作保全语义不变。
Refs: 本仓 governance 收尾实录(EXT-1 与 governance-reliability 两轮)。
2026-10-05 15:00:20 +00:00
weichen c1fdf0141c Merge current main while preserving governance repairs
Why: main advanced with merged-task-name and legacy evidence guards during this task.

Evidence: SELF 44 lifecycle regressions pass after resolving both hunks; independent review repairs are recorded in the task card.

Impact: retains both task-start protections and the stronger JSON/legacy receipt reader, without rewriting either branch history.

Refs: Dev PR #211 and #212; .task/feature-governance-reliability.md
2026-10-05 13:11:50 +00:00
weichen b84667a697 Close review gaps in cleanup and evidence handling
Why: independent review found shared submodule metadata risk, quoted header leakage, stale JSON receipt blindness and missing abandon coverage.

Evidence: SELF 92 governance regressions pass; the original review receipt and replay output are recorded in the task card.

Impact: preserves external component worktrees, handles both evidence formats and adds targeted failure-path coverage; no product behavior changes.

Refs: .task/feature-governance-reliability.md; .task/reviews/governance-reliability.json
2026-10-05 13:07:10 +00:00
weichen 8af945a1d5 Make development gates preserve work and verifiable evidence
Why: cleanup, component synchronization, receipt recording and credential handling could contradict the documented development boundaries.

Evidence: SELF 75 isolated governance tests and source checks are captured in .task/feature-governance-reliability.md; combination and CI verification follow.

Impact: hardens local task and CI tooling, aligns policy and component documentation, and adds continuous regression tests without changing product behavior.

Refs: .task/feature-governance-reliability.md; policy/governance.md; policy/platform-admission.md
2026-10-05 12:36:02 +00:00
weichen 1e0508e8a7 Skip non-hex cells in the sync evidence scan
Why: 证据命令含 || 时 evidence.sh 把表格单元格里的管道转义为 \|\|,cmd_sync 按裸 |
切行把碎片当 HEAD 传给 git diff,fatal 128 在 set -e 下杀死 sync(本卡功能负例行实测触发,
task-sync 门禁被卡死)。
Evidence: bash -n 通过;含转义管道行的本卡上 bash scripts/task.sh sync 正常完成(WARN 照发、
exit 0);修复后 make test 全链重跑。
Impact: 仅 cmd_sync 证据扫描加十六进制过滤;WARN 语义不变。
Refs: 本卡 12:30-12:32 五次 sync 中毒复现记录。
2026-10-05 12:33:06 +00:00
weichen e58035a8e4 Guard task-start against reusing a merged branch name
Why: 合入后再 task-start 同名分支会从新 main 长出第二段历史并覆盖已合入任务卡
(2026-10-05 EXT-1 复核轮实测,两轮证据差点丢失);原校验只看本地分支能否创建。
Evidence: bash -n 通过;功能负例——start feature/ext-1-inproc-handler 被拒且无
worktree 副作用;make test 全链 exit 0;task-sync 基线 43d33aa。
Impact: 仅 scripts/task.sh cmd_start 增加已合入同名分支检查,其余子命令行为不变。
Refs: EXT-1 任务卡复核轮记录(.task/archive/feature-ext-1-inproc-handler.md)。
2026-10-05 12:30:25 +00:00
weichen 0123cec450 Sharpen the sync evidence warning to non-card changes only
Why: evidence rows are written before their containing card commit, so a naive
HEAD-diff would flag every task's evidence as stale and train people to ignore
the warning.

Evidence: bash -n clean; the live task-sync for this task exercises the new
path (warning fires only when a non-.task diff follows an evidence row's HEAD).

Impact: scripts/task.sh cmd_sync now excludes .task from the staleness diff;
AGENTS.md wording aligned (three-output evidence via make evidence).

Refs: task card evidence table; guidelines verification.md tool-written rule.
2026-10-05 10:51:39 +00:00
weichen efa701279f Fix evidence CMD quoting and record first tool self-tests
Why: the make-variable pass-through re-quoted CMD and broke any command
containing quotes (caught by the redaction self-test before it could run).

Evidence: redaction self-test now records 'token <redacted> hello' with quoting
intact (row sha256 aae6a895); negative 'false' case earlier recorded exit=1
row and propagated rc — both in the task card evidence table.

Impact: CMD now travels via environment (CMD="..." make evidence); SRC/TAIL
stay make variables; usage strings updated in Makefile/AGENTS.md/task.sh
template comment.

Refs: task card evidence table; guidelines draft.10 tool-written-evidence rule.
2026-10-05 10:48:31 +00:00
weichen ba83a17c11 Add evidence gates: facts registry, evidence tooling, and precheck checks
Why: declarations were passing as capability; hand-transcribed outputs flowed
through cards and PR bodies as if they were execution evidence, and stale
external facts (e.g. the dead git-panel host) kept being trusted until burned.

Evidence: guidelines draft.10 (PR Development-Guidelines#4, merged af199ee)
pinned here; policy/facts.md F1-F4 each re-verified on 2026-10-05 before
registration (endpoint version, token HTTP 200 via header only, SSH ls-remote,
dead-host negative probe); scripts syntax-checked (bash -n); tool self-tests
and make test recorded in the task card via the new make evidence.

Impact: new AGENTS.md section (SELF/REPLAY/GATE, tool-written evidence,
replay-on-review, zero-trust facts, honest-empty); make evidence/facts-verify;
precheck gains [hooks]/[facts], task-sync gains stale-evidence-HEAD warning;
task-start cards now embed the evidence table; gitlink advances to draft.10.

Refs: task card .task/feature-evidence-driven-gates.md; guidelines CHANGELOG
0.1.0-draft.10.
2026-10-05 10:47:27 +00:00
weichen 421ee87d04 Normalize the rebuild args comparison to stop spurious drop warnings
Why: adjust_args_for_bin strips the leading space of its return while the
rebuilt args keep it, so every rebuild carrying --dsn/--auth compared
unequal and warned that the legacy binary had the flags dropped even when
nothing was dropped — misleading during incident triage.

Evidence: bash -n clean; against the real dev binary the normalized
comparison reports no drop and the flags survive intact; make test green.

Impact: warning now fires only when flags are actually filtered; no
behavioral change to start/deploy.

Refs: PR #188
2026-10-05 02:23:32 +00:00