[Kernel][G11 G13] Protect host-qualified source cache ownership, locking and dispatch identity #61
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#59 [Kernel][G11] Own concurrent tasks, workspaces and manual-edit reconciliation
Creatidy/creatidy-kernel
Reference
Creatidy/creatidy-kernel#61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Owner: Kernel. Make canonical source cache identity include the host and protect acquisition/replacement/cleanup with real ownership and locking; use one shared source/baseline validation before every dispatch, including explicit overrides. Source: shared architecture v1.0, sections 1-8, 9.2-9.4, 10-18 via #46 brief.
Why
Repositories with identical owner/name on different hosts currently collide. An unverified clean directory can be removed, concurrent acquisitions can race, and preflight checks do not automatically protect task run overrides. Users must not lose source data or execute the wrong repository.
Current Evidence
At
eb4f4a2956, source_cache.py source_cache_key:59-70 uses URL path only; _fresh_clone uses PID staging, writes marker at203 without checking it, discards target at204/287 and has no acquisition lock. Exact remote verification/symlink refusal/bounded fetch exist and must remain. task preflight checks origin/clean source/structural baseline, while resolve_source returns explicit override and run_task/prepare_workspace do not reuse these checks. #44/PR #45 proves layout independence, not cross-host/concurrent ownership.Scope
Define full canonical host/origin/repository identity without changing immutable task identities in place. Use existing lock/atomic publication mechanisms with acquisition/fetch/replace/cleanup ownership and current-use lifetime. Verify owned marker/metadata before destructive action; user/foreign/unrecognized trees are refused or preserved. Share source/base/clean/baseline validation between preflight and dispatch; no sibling search. Plan safe old-cache migration explicitly.
Acceptance Criteria
Reuse
Reuse canonical Forge refs, bounded Git transport, existing source acquisition and SQLite/local locking/atomic publication patterns. Compare maintained Git/cache workspace mechanisms and native locking before adding code; exact revisions/license/negative/security/dependencies/maintenance evidence required. No repository discovery/cache framework.
Dependencies And Priority
Immediate data/identity safety before concurrent tasks or explicit-override live execution. Can repair independently of choosing future harness/gateway. Approved intake #49 consumes freshness; multi-task workspace ownership consumes locked sources; G13 migration receives compatibility evidence.
Constraints And Permissions
No destructive cleanup of unowned data, guessing host/sibling paths, source remote mutations, private data copying or immutable identity rewrite. Synthetic local repositories and forced concurrency suffice initially; real forge acquisition requires scoped read access, and live dispatch separately needs inference/effect authority. New migration authority beyond existing ownership requires owner decision.
Links
Non-Goals
No arbitrary filesystem discovery, shared source DB or changes to workload repository.
Implementation published as PR #75: #75
Base
1deb32900d10dab6a3baad0c454ef9aa19c58733; HEADb0550563f8f5a9f0104444b6de3c230c8043ce02. Qualified v2 ownership/locks, non-destructive staging/publication and legacy handling, shared source/snapshot admission and literal historical recovery implemented. Parent closed-environmentmake check package-check audit && git diff --checkpassed: 1305 tests +57 subtests, 53 optional native verification skips; installed offline source smoke passed. No live workload acquisition or inference. Fresh independent exact-HEAD whole-PR review is next; issue remains open. #53 universal executor proof and broader concurrency/isolation remain separate gates.Completed through PR #75: #75
Verified normal merge
71c132761b522c7faeee1a1aca51f1a296a947echas parents base1deb32900d10dab6a3baad0c454ef9aa19c58733and independently approved HEAD6b8074484fcde26c4d0089bb593401f344139b59; integrated tree equals approved tree24c516c6cdca6e368eb5bdf639f1fe65fe12e87b. All normal implementation/remediation commits retained. Five fresh whole-PR reviews consumed; final ordinal5 APPROVE/findings[].Integrated closed-environment
uv sync --lockedandmake check package-check audit && git diff --checkpassed: 1321 tests +57 subtests, 53 optional verification-only native skips; format/lint/types/inward imports/secret scan/audit, reproducible wheel/sdist, isolated CLI/intake/source smoke passed. Canonical exact-head CI2377 and integrated CI2378 SUCCESS.Acceptance received with synthetic real-Git/native-filesystem evidence: distinct hosts/ports and strict single origin; inode/token ownership and non-destructive preservation; same-thread/process acquisition/fetch/use contention and native-child lease retention; no partial publication; exact remote-only base transfer; zero-start wrong-origin/dirty/baseline/pin/indirection/helper/gitlink/expiry negatives; historical #143/#166 source/Attempt identities and stopped recovery preserved. Missing original Attempt objects refuse rather than rebuild from mutable source. Unknown legacy/corrupt/staging bytes remain untouched; no destructive cleanup or live workload acquisition.
This closes only #61's trusted cooperative native-local source boundary. #53 universal executor conformance, wider concurrency/isolation, live execution, product GO, main/releases/deployment remain unreceived or separately authorized. Issue closure follows verified integration and acceptance, not PR approval alone.