Skip to content

[Security] Enforce one canonical local-audio resource budget before analysis #781

Open

Description

@seonghobae

Canonical implementation authority

Resource Admission & Decode의 단일 source owner는 PR #866 (fix/audio-resource-policy-781)입니다. Current exact head는 7156aebd4a745cab4842d15aba319a72c80e1d98, protected base는 develop@314ddeae7b775a4957594b599358c8255617eb2e이며 Open / Draft / mergeable입니다. 현재 head는 protected develop의 ordinary ahead-only descendant이며 force-push/destructive rebase를 사용하지 않았습니다. 이 bounded context를 다른 PR로 fan-out하지 않고 dependent/preservation delta는 완전 승계 전까지 닫지 않습니다.

#970은 durable Project Persistence, #1160은 protected/released Resource Admission + Project Persistence의 Active Player 소비를 소유합니다. #1204는 repository-generic Security Notes checker, central .github는 required-workflow/CodeQL lifecycle의 canonical owner입니다. Draft #866을 released truth로 소비하지 않습니다.

Current resource policy

#866은 encoded-byte admission, source sample-rate/channel/duration admission, canonical float32 mono decode, decoded sample/memory/finiteness checks, owned-process timeout/termination/reap, analysis protocol admission과 관련 회귀를 같은 owner lane에 유지합니다. 현재 기본 admission은 source 8–192 kHz, 1–2 channels, 15분, encoded 100 MiB, canonical 44.1 kHz float32 mono입니다.

#1244 exact-limit harness는 feature-gated standalone helper + process_output_large_streams integration으로 통합됐고 superseded libtest self-reentry unit은 제거됐습니다. Exact predecessor c0c3956d10edb6e21a154c9c5de075dd2bde3217의 dedicated run 35686172417은 Windows Server 2025와 macOS 15에서 stdout/stderr 각각 정확한 1 MiB ceiling과 inherited-handle descendant cleanup을 통과했습니다. 이 predecessor 결과는 current head에 전용하지 않습니다.

Windows process-tree owner

RED 709c452266a202d767db640c26ada4bc0e934779은 helper parent가 inherited stdout/stderr를 가진 5초 descendant를 시작하고 즉시 종료하도록 하며, production cleanup이 descendant lifetime/1 MiB ceiling을 약화하지 않고 2초 미만에 반환하도록 요구합니다.

Production ab3ae64760f320fd0b5fa58c6c0327d125b748c0은 desktop core에 OwnedProcess를 도입했습니다. Windows에서는 unnamed Job Object + JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, CREATE_SUSPENDED, pre-execution Job assignment, Toolhelp/ResumeThread, retained Job handle, tree-wide TerminateJobObject 순서로 ordinary descendant lifetime을 소유합니다. Unix는 pre-exec process-group semantics를 유지합니다. spawn → AssignProcessToJobObject best-effort 설계는 descendant escape window 때문에 채택하지 않았습니다.

Analysis runner RED → owner unification

남아 있던 product gap은 run_analysis_engine이 configure_owned_process + Command::spawn을 직접 조립해 Windows에서 Job Object owner를 우회하던 것입니다.

RED 6025e120c9c9b18e8984281c3acde1478893b781은 Tauri analysis runner가 spawn_owned_process를 사용하고 old configure-then-spawn을 사용하지 않으며, direct-parent terminal/cancel/timeout/protocol failure에서 inherited reader join 전에 동일 process-tree owner를 정리하도록 요구합니다.

Repair lineage:

  • 5533cbc95eb6d7b90c7422c9d0f50540ccb31037: OwnedProcess의 narrow native capability를 공개하되 PID/Job handle은 private 유지.
  • 01770c9934b5b0f4a7d2e4b78b1d85f553b855bd: desktop-core crate root에서 owner export.
  • ae9a0f1cfbb2861b841f8ad343344d5d0b06af18: run_analysis_engine을 spawn_owned_process + owner methods로 이동. Job identity, JSONL admission, timeout/cancellation, direct-child exit-status truth는 유지.
  • 14885e893a55dbe46d28389dc9c50df7ecf8e261: dedicated Windows/macOS workflow가 core executable descendant/dual-pipe contract와 Tauri adapter contract를 같은 exact source head에서 모두 실행.
  • 2ec4d6e4b9c71ea7ae6e7bc75b445675748082a8: workflow-policy regression을 new owner paths에 binding.

No hosted RED is claimed because RED와 repair는 consecutive ordinary descendants입니다.

Focused-workflow RCA and predecessor GREEN

Exact 7a10a43bb643827c8674677e58ba42c64b81ac1a, run 35689880708에서 macOS core descendant/dual-pipe tests는 통과했지만 새 Tauri adapter step은 test 실행 전에 compile failure가 났습니다. 원인은 tauri::generate_context!()가 frontendDist: "../dist"를 요구하는데 focused workflow가 apps/desktop/dist를 만들지 않았기 때문입니다.

Repository canonical ci / rust-check의 pinned Node/npm → npm ci → npm run build --workspace @bandscope/desktop → Tauri check/test 순서를 그대로 채택했고, 빈 dist 디렉터리만 만드는 우회는 기각했습니다. 8a6a17a.../85b346e...가 workflow prerequisite/policy를 수리했고 600792545c...가 doctoring을 currentize했습니다.

Predecessor exact 600792545c8ed1f39f3d30aebf48d3926857a3bb, dedicated run 35690262543은 SUCCESS on Windows Server 2025 and macOS 15였습니다. 두 job 모두 executable descendant/dual-pipe contract, pinned npm/frontend prerequisite, native Tauri owned-process adapter contract를 통과했습니다. Build-baseline 35690262534와 Semgrep 35690262550도 predecessor exact head에서 SUCCESS였습니다. Current head가 이동했으므로 이 결과를 current evidence로 전용하지 않습니다.

Repository rust-check RED → current repair

Fresh child-check inspection에서 predecessor 600792545c...의 repository ci run 35690262503 안에 terminal failure가 확인됐습니다. gate / ci / rust-check job 106663752915은 macOS 15에서 cargo +stable check와 실제 product compile을 통과한 뒤 analysis_job_cancellation_contract의 8 tests 중 2개만 실패했습니다.

두 실패는 product behavior가 아니라 stale source-contract expectation이었습니다. 해당 test file은 Tauri runner가 아직 configure_owned_process(&mut command)와 terminate_owned_process(&mut process)를 호출한다고 요구했지만, canonical repair는 이미 spawn_owned_process(&mut command)와 OwnedProcess::terminate()로 이동했습니다. Dedicated native adapter contract는 이 새 owner path를 predecessor exact head에서 이미 실행 검증했습니다.

Ordinary descendant 7156aebd4a745cab4842d15aba319a72c80e1d98은 그 test file의 네 stale source-string assertion/message만 수리했습니다. 이제 spawn_owned_process(&mut command)와 process.terminate()를 요구하면서 process.kill(), Tauri-local process-group helper, Tauri-local POSIX signalling은 계속 금지합니다. Product source, timeout, capture ceiling, Job Object semantics, dependency, workflow/gate policy는 바꾸지 않았습니다.

Current exact generation은 새로 생성됐으며, latest read에서 build-baseline 35708793788, Semgrep 35708793853, native process-owner 35708793890, SBOM 35708793840, Security Scan 35708793924, CodeQL PR 35708793972, repository ci 35708793852가 queued/pending입니다. Predecessor GREEN을 새 head에 전용하지 않고 no-op wake commit/blind rerun도 하지 않습니다.

Claim boundary

두 product-owned subprocess path는 source에서 ordinary descendants에 대해 같은 owner를 사용합니다: Unix process group, Windows pre-execution Job Object admission. 이것은 sandbox, deliberate process-group/session escape 또는 Windows breakaway 방지, external process containment, egress/filesystem isolation, CPU/RAM/PID/disk/accelerator quota를 의미하지 않습니다.

1 MiB stdout/stderr ceiling은 parent-side capture만 제한합니다. Rights-cleared full-length rehearsal audio로 cancellation/resource-return latency, temp-artifact cleanup, decoder/resampler/downstream RSS/VRAM, explicit CPU/GPU budgets와 recognized MIR reproducibility를 별도로 검증해야 합니다.

Protected / central authority

BandScope protected develop과 central protected .github/main은 매 run fresh 확인합니다. Central workflow/bootstrap/CodeQL settlement를 BandScope copied workflow, synthetic status, duplicate scanner, self/admin approval 또는 gate weakening으로 우회하지 않습니다. Protected scripts/ci/agent_mention_router.py는 trusted PR-comment mention을 review agents로 dispatch하는 경로이며 source-fix writer contract가 아닙니다.

Next acceptance

  1. 7156aebd...를 유지하고 already-generated current-head gates의 terminal 결과만 RCA합니다.
  2. Current exact native owner lane과 repository rust-check가 GREEN을 다시 세워야 하며 600792... predecessor results를 전용하지 않습니다.
  3. Unchanged final head에 대해 zero actionable unresolved findings와 qualifying independent non-author approval을 확보합니다.
  4. Protected required contexts와 central settlement가 동일 identity에서 충족된 경우에만 normal protected merge합니다.
  5. Protected fix(audio): establish canonical local-audio resource policy #866 이후 fix(project): enforce crash-safe revision-bound persistence #970 crash-safe Project Persistence → feat(player): admit and bind playable stem artifacts #1160 Active Player consumption 순으로 ordinary non-force reconciliation합니다.

Scientific / commercial boundary

Current policy가 source rate/channel/duration과 decoded CPU-memory footprint를 admission하더라도 production scientific acceptance는 별도입니다. Rights-cleared full-length rehearsal audio로 decoder/resampler/downstream peak RSS/VRAM, cancellation latency, inherited handle/pipe return, abnormal-child cleanup, explicit CPU/GPU execution budgets와 recognized MIR reproducibility metrics를 측정해야 합니다. Synthetic/generated arrays는 unit boundary에만 사용합니다.

UI Delivery Gate: FAIL / Commercial Release Gate: FAIL. Signing/notarization, immutable release, SBOM/provenance/reproducibility, updater rollback도 current Draft lineage에서는 완료되지 않았습니다.

Activity

  1. added
    area: apiAPI, protocol, event, or external contract
    area: ci-cdCI, GitHub Actions, checks, release, or supply chain
    area: dataDatabase, schema, migration, ETL, or lineage
    area: securitySecurity boundary, hardening, or vulnerability prevention
    status: triagedOpen issue has an organization taxonomy assignment
    type: featureNew or expanded product capability
    on Aug 22, 2026
  2. seonghobae commented on Sep 9, 2026

    @seonghobae
    CollaboratorAuthor

    Residual after ccda5980d8c40cab5a88c39148e19775c35e311d: stable caches missing separation.duration_seconds now fail closed, but this is not metadata-generation atomicity. The outer API retains the first metadata snapshot while archive admission performs a second read, so first-read/second-read replacement remains in scope for the immutable manifest/generation contract. Bind metadata + private NPZ replay bytes + #970-owned admitted-source digest/reference; do not add pathname/timestamp identity as a competing authority.

  3. seonghobae commented on Sep 9, 2026

    @seonghobae
    CollaboratorAuthor

    #866 current Resource Admission repair has advanced normally to exact 3476e31fa19df269efa6bbf6c767e539ce81335c on protected develop@314ddeae7b775a4957594b599358c8255617eb2e.

    Fresh parser finding: persisted feature-cache JSON could contain duplicate object member names and Python's ordinary dictionary materialization could collapse them before semantic admission. RED c7721839fb31dcb6cb5720f03bf24ee73250b05b covers duplicate top-level schemaVersion and nested separation.duration_seconds. Production 10f7a369ef1277d8a50e6db2a80047185b35a6af uses one object_pairs_hook to reject duplicate members at every JSON object depth; the existing bounded ValueError path turns the sidecar into a cache miss. Doctoring/current descendant 3476e31fa19df269efa6bbf6c767e539ce81335c records RFC 8259/Python parser rationale and rejected first/last-wins alternatives.

    This closes duplicate-member representation ambiguity only. It does not bind the first metadata snapshot, private NPZ snapshot, and native verified source digest into one immutable generation. The versioned manifest/generation remains the next persistence prerequisite. Hosted RED and exact-head Python GREEN are not claimed yet; #1176 remains sole owner of the inherited protected-base Ruff formatter prerequisite.

  4. seonghobae commented on Sep 9, 2026

    @seonghobae
    CollaboratorAuthor

    Fresh exact-head authority for canonical #866 remains 9bba38562b7827edeac0e5c6c82a0b992fc3ced5 on protected develop@314ddeae7b775a4957594b599358c8255617eb2e.

    Repository ci run 34386371232, job 102583699528, has now been read at raw-log level. It passes docs/Security Notes/security-pattern/supply-chain/GitHub-bootstrap/workspace ESLint/Python docstrings and uv run ruff check src tests, then repository-pinned Ruff 0.15.5 fails only at ruff format --check src tests for the five #866-owned files already named in this issue; pytest is not reached. test_supply_chain_policy.py is confirmed out of the failure set after the ordinary #1176 ancestry adoption. A canonical existing-branch OpenCode repair has been requested for those five files only; no competing PR, self-modifying formatter workflow, rebase/force-push, or gate weakening is being used.

    CodeQL is a separate central-owner condition, not a BandScope source finding. Run 34386371122 successfully dispatches exact-head scans, then compatibility shards fail closed only because authenticated codeql-dispatch/<language> terminal verdicts remain pending. Fresh BandScope evidence has been handed to ContextualWisdomLab/.github#1929; do not rerun the compatibility shards before a terminal owner verdict because their own attempt>1 contract rejects a rerun without that verdict.

    Current exact-head build-baseline, SBOM, Security Scan, and SAST Semgrep are terminal-success. Keep #866 Draft until formatter repair reaches causal pytest evidence, central required gates are terminal, and a qualifying independent current-head approval exists.

  5. seonghobae commented on Sep 9, 2026

    @seonghobae
    CollaboratorAuthor

    Fresh Resource Admission authority update: canonical #866 is still exact 9bba38562b7827edeac0e5c6c82a0b992fc3ced5, Draft/open/mergeable on protected develop@314ddeae7b775a4957594b599358c8255617eb2e. Raw exact-head CI reaches Ruff 0.15.5 and stops at ruff format --check src tests with exactly five #866-owned files; pytest is not reached. A same-branch formatter-only repair has been dispatched with no gate weakening or foreign-file edits.

    Fresh overlap audit found #1197 (48b58ab05fa02563e07c44069ff7300837168ee0) mixed three owners. It has been converted to Draft. Its unique projectId whitespace admission regression is valid and must succeed into #866 after the formatter repair: current #866 rejects exact ./.. and separators but still admits leading/trailing whitespace. #1197's test_supply_chain_policy.py formatter delta remains #1176 ownership. Its setuptools CVE-2026-59890 floor is valid supply-chain work, but the current lock regeneration also drifts Torch 2.12.1→2.14.0 plus Triton/CUDA/cuDNN/NCCL; that ML-stack drift is not acceptable as incidental CVE repair and has been sent back for a minimal setuptools-only resolution if solvable. No #1197 checks/reviews transfer to #866.

  6. seonghobae commented on Sep 9, 2026

    @seonghobae
    CollaboratorAuthor

    2026-09-10 KST owner sweep: canonical #866 remains exact 9bba38562b7827edeac0e5c6c82a0b992fc3ced5, Draft/open, with repository CI still stopping before pytest at Ruff 0.15.5 formatting of the five Resource Admission-owned files already named in this issue. I re-dispatched only that formatter-equivalent repair on the existing #866 branch and separately requested an independent exact-head OpenCode verdict; no new source writer, retry commit, rebase, force-push, or gate bypass was created. Preservation authority was repaired in #985 so it no longer treats an old #866 Draft SHA or the now-implemented feature metadata/NPZ/source manifest as current truth; its unsuperseded M4A evidence remains preserved. #1194 authority was likewise refreshed to current #866 semantics and remains open until successor exact-head GREEN proves complete succession. Next causal source order remains: five-file Ruff descendant → first real pytest result → canonical projectId whitespace RED/fix from #1197 → final rehearsal-result generation binding.

  7. seonghobae commented on Sep 11, 2026

    @seonghobae
    CollaboratorAuthor

    Canonical live correction for #781: #866 is now exact 43938abaab610a67a1e68d5298d39849a8544fe7 on protected develop@314ddeae7b775a4957594b599358c8255617eb2e, not the older ceaca95f... state in the issue body. Ordinary descendants 0b23a19... and 43938... add focused traceback/path-leak regressions and the bounded traceback-free logging repair. Fresh hosted ci run 34564617166, job 103154639731 passes docs/Security Notes/security-pattern/supply-chain/GitHub-bootstrap/docstrings and Ruff 0.15.5 check, then fails first at Ruff format only: src/bandscope_analysis/api.py would be reformatted (1 file would be reformatted, 130 files already formatted). pytest/coverage therefore has not run on this exact head. The existing canonical writer has the exact pinned-formatter-only repair instruction; do not start a competing source writer. Producer/replay feature-cache admission symmetry remains the next semantic finding, then real Python 100%, then #1197 focused projectId whitespace succession.

  8. seonghobae commented on Sep 22, 2026

    @seonghobae
    CollaboratorAuthor

    Current-head evidence update for canonical #866: exact 7156aebd4a745cab4842d15aba319a72c80e1d98, resource-admission-process-output-native run 35708793890 is now terminal SUCCESS on both Windows Server 2025 and macOS 15. Both jobs passed the exact-limit dual-pipe contract, pinned npm/frontend prerequisite, and native Tauri OwnedProcess adapter contract after the stale source-contract assertion repair. This re-establishes focused cross-platform evidence on the repaired head; it does not transfer predecessor broader results. Current broader state remains nonterminal: build-baseline 35708793788 in progress, repository ci 35708793852 / Security 35708793924 / SBOM 35708793840 / Semgrep 35708793853 queued, CodeQL PR 35708793972 pending. Keep Draft and do not merge/mark Ready until same-head broader settlement and independent non-author approval.

  9. seonghobae commented on Sep 22, 2026

    @seonghobae
    CollaboratorAuthor

    Current-head settlement update for canonical #866 exact 7156aebd4a745cab4842d15aba319a72c80e1d98:

    • dedicated Resource Admission Windows/macOS 35708793890: SUCCESS;
    • build-baseline 35708793788: SUCCESS;
    • repository ci 35708793852: SUCCESS;
    • Security Scan 35708793924: SUCCESS;
    • SAST Semgrep 35708793853: SUCCESS;
    • SBOM 35708793840: SUCCESS;
    • CodeQL PR 35708793972: terminal FAILURE, but child RCA is the central delegated-CodeQL publication/settlement signature rather than a Resource Admission source finding.

    For CodeQL, detection 106734445522 succeeded; actions/python/javascript-typescript compatibility jobs 106801532499 / 106801532530 / 106801533519 each read the current-head dispatch verdict successfully and then failed at Release runner or enforce current-head CodeQL verdict; the later coordinator 106855384749 completed dispatch SUCCESS. The receiver log records VERDICT_STATE=pending and expects the dispatch workflow to publish a terminal verdict and rerun the exact failed job, but the already-failed receivers did not later settle.

    This exact BandScope receipt has been routed to canonical central owner ContextualWisdomLab/.github#1929 as comment 5783243533. #866 source stays stable; no no-op wake, blind broad rerun, synthetic status, copied scanner, or gate weakening. Independent qualifying current-head approval also remains absent, so #781/#866 stay Open/Draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: apiAPI, protocol, event, or external contractarea: ci-cdCI, GitHub Actions, checks, release, or supply chainarea: dataDatabase, schema, migration, ETL, or lineagearea: securitySecurity boundary, hardening, or vulnerability preventionenhancementNew feature or requestpriority: mediumNormal-priority or P2 workstatus: triagedOpen issue has an organization taxonomy assignmenttype: featureNew or expanded product capability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions