fix(session-analysis): qualify and harden DSH evidence for rc.8 - #97
Open
Cobb04 wants to merge 13 commits into
Open
fix(session-analysis): qualify and harden DSH evidence for rc.8#97Cobb04 wants to merge 13 commits into
Cobb04 wants to merge 13 commits into
Conversation
Extend the existing dsh-v1 format-0 reader with strict rc.8 interrupted-assistant and team-event validation while keeping team records account-only. Add native-derived regression fixtures and document the audited rc.7/rc.8 evidence slice. Validated with the focused DSH suites, the full session suites, npm test, generated-code checks, workspace package tests, documentation links, and pack verification. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Only emit normalized success and error fields when pinned DSH records isError. Keep explicit true and false behavior and call/result correlation covered by provider tests. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Match the pinned rc.8 home resolver by falling back to ~/.dsh for blank or whitespace-only inherited DSH_HOME values while preserving strict explicit-home validation. Implements the AC-1 boundary in docs/specs/2026-08-18-93-deepseek-harness-session-evidence.md for QoderAI#93 and was validated by the focused regression plus the full DSH discovery owner. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Allow the pinned rc.8 JSON value domain only for unknown events explicitly marked ignorable, while keeping every known event payload on its strict object schema and omitting unknown payloads from normalized evidence. Implements the AC-7 boundary in docs/specs/2026-08-18-93-deepseek-harness-session-evidence.md for QoderAI#93 and was validated by the focused six-class regression plus the full DSH discovery owner. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Project only events at or beyond the pinned seedLength boundary after the complete artifact has passed decoding, relationship validation, and surface folding. The all-seed, mixed, and malformed-prefix regression preserves lineage without double-counting parent prompts, usage, tools, or outcomes. Implements the AC-6 provenance boundary in docs/specs/2026-08-18-93-deepseek-harness-session-evidence.md for QoderAI#93 and was validated by the focused provider regression, the full provider owner, and core-facts aggregation tests. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Match pinned rc.8 directory discovery by refusing project and session symlinks, then verify every candidate artifact realpath remains within the canonical configured sessions root before reading it. Escape cases are skipped without exposing external paths. Implements the AC-2 source-boundary contract in docs/specs/2026-08-18-93-deepseek-harness-session-evidence.md for QoderAI#93 and was validated by the focused two-level symlink regression plus the full DSH discovery owner. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Preserve contiguous raw JSONL rows when an uncommitted suffix is torn or malformed, while rejecting corruption proven committed by a later turn boundary. Recover complete Zstd frames across systematic final-frame truncations and keep complete checksum or structural corruption fail-closed. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Partition lifecycle groups when a reused stable invocation id opens again after its prior post/result boundary. This preserves sequential occurrences through shared deduplication and tool tracing without changing provider-native identifiers. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Align the Issue QoderAI#93 specification and adapter matrices with the audited RC7/RC8 format-0 slice, including the independently tested persistence, discovery, ownership, outcome, and lifecycle contracts. Keep all unavailable host and persistence capabilities explicit. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Extend the QoderAI#93 regressions in docs/specs/2026-08-18-93-deepseek-harness-session-evidence.md with falsy JSON values and a seed boundary that splits a valid tool lifecycle. The focused discovery and provider owners passed without production changes. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Keep the historical RC7 links for QoderAI#93 while binding RC8-only and requalified contracts to their exact owners at 141eb6fef83422698aef7a981029e843e8161534 in docs/specs/2026-08-18-93-deepseek-harness-session-evidence.md. All seven fixed URLs returned 200 and the documentation link graph passed. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Windows file identities can exceed JavaScript safe integer precision. Use full-width filesystem stats for the existing before/open identity comparison so distinct files cannot compare equal through Number precision loss. When inode identity is unavailable, retain the conservative metadata fallback with exact nanosecond timestamps. This hardens the existing fail-closed swap check; it does not claim to eliminate all filesystem TOCTOU races. Validated with the Node 22.20 secret-scan and agent suites, the bounded full repository suite, generated checks, workspace tests, and package verification. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Repeated native invocation IDs are legal after a prior lifecycle closes. Lifecycle deduplication previously sorted by timestamp before occurrence partitioning, so non-monotonic timestamps could reorder two valid occurrences and collapse them into one. Partition lifecycle occurrences using stable provider/native order while preserving timestamps for duration evidence and final presentation. Implements QoderAI#93 AC-6 in docs/specs/2026-08-18-93-deepseek-harness-session-evidence.md and was validated by focused lifecycle and DSH suites, all session suites, npm test -- --maxWorkers=4, and package verification. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Qualifies Better Harness
dsh-v1against the audited DeepSeek Harnessdsh-v0.1.0-rc.7/dsh-v0.1.0-rc.8format-0 persisted session-evidenceslice. The delivered capability is read-only
sessionAnalysisfor raw JSONLand feature-detected framed Zstandard evidence; it is not full DSH host or full
rc.8 support.
The rc.8 work strictly validates interrupted assistant evidence and four known
team event types without projecting team analytics. It also closes seven
evidence-contract gaps covering unknown tool outcomes, home resolution,
ignorable events, seed ownership, sessions-root containment, crash tails, and
reused native call IDs. A separately reviewable Windows secret-scan commit is
disclosed below because the mandatory Windows lane exposed that pre-existing
CI-blocking defect.
Why
aligned with the pinned rc.7/rc.8 persisted contract, fail closed on
unsupported drift, and give maintainers current native, regression,
cross-platform, packaging, and risk evidence for review.
Traceability and Scope
docs/specs/2026-08-18-93-deepseek-harness-session-evidence.mdcompleted reused-invocation contract for equal and non-monotonic timestamps.
scripts/session-analysis/platforms/dsh.mjs— DSH persisted-evidence owner.scripts/session-analysis/episode-contract.mjs— shared lifecycleoccurrence owner.
scripts/agent-guardrails/secret-scan.mjs— isolated Windows CI/securityfollow-up.
configured assets, plugin lifecycle, shell, packaging, Quickstart, report
routing, SQLite/custom persistence, team analytics, and native DSH E2E on
every operating system.
The compatibility boundary is: Better Harness
dsh-v1,sessionAnalysisonly, DSH persisted format
0, raw JSONL and feature-detected framed Zstandard,qualified against the audited rc.7/rc.8 format-0 persisted session-evidence
slice.
What Changed
RC8 compatibility
assistant/message.data.interrupted: truemarker.team/member,team/task,team/message/queued, andteam/message/deliveredand their audited replayrelationships.
activity, or analytics.
Evidence and compatibility fixes
isErrorremains unknown instead of beingfabricated as success.
DSH_HOMEis treated as unset; explicit invalid CLI valuesremain invalid.
ignorable:trueevents accept valid JSON-valued data while knownevent schemas remain strict.
seedLengthhistory is decoded and validated but excluded fromchild-owned activity.
closed on escaping symlinks or canonical paths.
committed structural/checksum corruption remains rejected.
occurrence even when timestamps are equal or non-monotonic. Occurrence
grouping follows stable provider/native lifecycle order; timestamps remain
temporal presentation/duration evidence and do not define invocation
identity. Native IDs are neither rewritten nor synthesized.
Windows CI follow-up
The required Windows CI lane exposed a pre-existing secret-scan file-identity
precision defect. The focused final commit preserves full-width filesystem
identity during the existing before/open check. It is unrelated to the DSH
behavior in this PR, independently reviewable and revertible, and included here
as the CI-blocking exception required to restore the mandatory Windows lane. It
does not claim to eliminate all filesystem TOCTOU races. Maintainer guidance on
accepting this isolated exception in #97 is welcome.
Change Type
Test and Review Evidence
npm test -- --maxWorkers=4npm run pack:verifygit diff --checkManual or visual evidence: Native rc.8 E2E was run in the recorded isolated
macOS/arm64 environment. Better Harness regressions were separately validated
across the repository's Windows/macOS/Linux CI matrix; this does not claim a
native DSH E2E on every OS.
Risk and Recovery
upstream drift.
corruption; seed ownership changes projection ownership while retaining
full validation.
generic episode owner; focused cross-host and full-suite regressions are
green.
retaining the existing before/open guard; it does not eliminate every
filesystem TOCTOU race.
no format migration, no persisted-data rewrite, and generated-source and pack
verification pass.
shared lifecycle completion, and Windows secret-scan exception to be reviewed
or reverted independently; no migration cleanup is required.
replacement/current-surface semantics remain outside fix(session-analysis): qualify and harden DSH evidence for rc.8 #97; full DSH host
support, SQLite/custom persistence, team analytics, and cross-platform native
DSH E2E remain out of scope.
AI Involvement
adversarial audit, and testing. The contributor independently compared the
delivered behavior with pinned DSH rc.8 sources, ran the recorded isolated
native E2E, inspected the resulting diff and cross-platform CI, and retains
final review responsibility. AI-generated analysis itself is not treated as
acceptance evidence.
Review Guide
Review commits in their actual oldest-to-newest order:
b2be0f6—fix(session-analysis): accept audited dsh rc8 events1ea8d17—fix(session-analysis): preserve unknown DSH tool outcomes7b2b7d1—fix(dsh): treat blank DSH_HOME as unset6280985—fix(dsh): accept JSON-valued ignorable events7a8cc31—fix(dsh): exclude inherited seed history from child activitya85cefc—fix(dsh): contain discovery within sessions rootf7653ed—fix(dsh): recover committed prefixes from crash tails09b7ad2—fix(session-analysis): retain repeated tool invocation occurrences1b6f938—docs(dsh): record audited rc8 evidence boundaries74229c2—test(dsh): strengthen compatibility edge coverage103c21c—docs(dsh): point rc8 evidence to rc8 sourcesf730a7d—fix(secret-scan): preserve filesystem identity precision53534b2—fix(session-analysis): preserve lifecycle order across timestamp driftChecklist
AGENTS.md,CONTRIBUTING.md, and the relevant canonical-owner guidance.Unchecked because the disclosed, independently reviewable Windows secret-scan
CI exception is technically unrelated to DSH; no unrelated local or generated
state is included.
CHANGELOG.md.CHANGELOG.mdis not updated because the accepted issue/spec does notexplicitly authorize a changelog edit; maintainer guidance is welcome.
Refs #93