Harden TIS credential, selection, and privacy contracts - #8
Conversation
|
@wormforce When convenient, could you review this PR? The downstream advisor mitigations are now shipped in v0.2.1, including a checksummed GitHub Release and clean macOS/Ubuntu/Windows bootstrap smoke. The upstream patch here remains the protocol-level fix for #4–#7; its branch passed the 326-test suite, audit, package, privacy, and Skill checks recorded in the PR body. I will address any requested changes promptly. |
|
@wormforce One concrete unblock for this PR: GitHub created the pull-request CI run, but it is The head is still mergeable against current |
pentaoa
left a comment
There was a problem hiding this comment.
Reviewed commit 7ce36b6. The build and 31 focused tests pass, but the following synthetic reproductions expose gaps that should be fixed before merging. No live selection mutation was performed.
-
[P1] Validate the selection round before declaring reconciliation conclusive. In
src/tis/remaining-selection.ts:482-500, reconciliation delegates toverifySelectionWritewithout checkingobservation.roundCodeagainsttarget.round. Abid.updatetarget forbxxk, bid 5, with the exact courseId/RWH present at bid 5 in twoyixuansnapshots returnsapplied. With the same matching bid but missing round metadata in both snapshots, it returnsnot_applied. Neither establishes the requested round's state. Treat missing/mismatched round evidence asstill_uncertainand add both cases to the tests. This blocks the exact-target contract in #6. -
[P2] Preserve planning fields when enrollment metadata is supplied through SKSJ.
src/tis/planning-projection.ts:100-106copies onlyentry.teacherandentry.room, while dropping the description.normalisePersonalScheduleEntrysupports SKSJ-only records but does not extract their bracketed teacher/room fields. A synthetic row withSKSJ: 'Synthetic course\n[Example Teacher]\n[Section A]\n[1-3周][Room 101][7-8节]'and no separate SKJS/SKDD yieldsteachingTeam: []androom: ''in the new default JSON. Previously the description retained those fields. Normalize the supported description fields before projection and test that path, so #7 does not remove information that planners actually need. -
[P2] Check duplicate-row credit conflicts before discarding duplicate fields. In
src/tis/selection-bundles.ts:73-91, same-component rows are collapsed beforeresolveCreditCarrierruns. Two records with the same explicit bundleId, id and rwh butxf: 2andxf: 3producecredits: 2,creditStatus: 'deduplicated', andselectableWithoutGuessing: true; reversing the input chooses 3 instead. The public contract says conflicting source credits are omitted as ambiguous. Retain/check conflicting credit evidence during deduplication and add the same-component variant of the existing conflict test for #5.
The Linux write read-back and actionable Secret Service diagnostics are useful improvements for #4. However, the reported issue only contains a generic lookup failure, so these tests do not establish that its specific desktop-session failure is resolved; keep that distinction explicit when closing the issue.
…rules fix: align course instances with academic calendar
…keychain-status fix(auth): bound macOS Keychain status probes
Summary
This is one conservative contract/safety patch for the four downstream-reported gaps:
courseId -> p_id/rwhsemanticstis selection reconcileoutcomes (applied,not_applied,still_uncertain)Safety boundaries
clientRequestIdis correlation metadata only and is not sent upstream; automatic retry remains forbidden.retainCourseSourceRecordis an explicit library diagnostics-only escape hatch and is never used by a CLI command.Validation
npm run checkTZ=UTC, plus an isolated tarball installation and public lecture-query smoke test.npm audit: 0 vulnerabilitiesnpm pack --dry-run: passed; new modules, docs, and Skill are in the tarballSkill is valid!Related to #4 — keep open pending verification in the reporter's actual Linux desktop session.
Fixes #5
Fixes #6
Fixes #7