Improve schedule UX with time semantics and credential error consistency - #23
Merged
Merged
Conversation
…nsistency - Add structured startAt/endAt (HH:MM Asia/Shanghai) to schedule entries alongside existing periodStart/periodEnd fields for compatibility - Support --date YYYY-MM-DD on 'tis schedule' to query specific dates, resolving teaching week from academic calendar automatically - Parse and expose structured 'rooms' array when multiple rooms detected (e.g. '505, 506'), keeping primary 'room' field for compatibility - Document official SUSTech period→clock mapping in docs/ARCHITECTURE.md as single source of truth for humans and agents (effective 2026-09-07) - Distinguish credential backend states: linux-encrypted-file master password missing/invalid now produce stable MASTER_PASSWORD_REQUIRED/INVALID codes - Unify auth status, doctor, and credential read error paths to consistently expose remediation mentioning SUSTECH_MASTER_PASSWORD when appropriate - All 468 tests pass Co-authored-by: Kunpeng Xie <pentaoa@users.noreply.github.com>
- Verify startAt/endAt are not added when period data is missing - Verify multiple rooms are parsed into rooms array - Verify single room does not populate rooms array - All 472 tests pass Co-authored-by: Kunpeng Xie <pentaoa@users.noreply.github.com>
Co-authored-by: Kunpeng Xie <pentaoa@users.noreply.github.com>
Addresses maintainer feedback on PR #23: - Change startAt/endAt from bare HH:MM to full ISO-8601 datetimes (e.g. 2026-09-15T14:00:00+08:00) for week-specific schedule queries - Enrichment now requires teaching calendar and week context - Only personal schedule entries with known dates get timestamps - Catalog schedule[] slots lack concrete dates, keep period fields only - Update enrichScheduleEntriesWithDatetimes to take teachingStartDate + week - Call enrichment in CLI layer after resolving calendar term - Update all tests to use correct bitmap format and verify ISO timestamps - Update docs: ARCHITECTURE.md, CHANGELOG.md, FEATURE_DEMO.md - Keep FEATURE_DEMO.md as requested - All 474 tests pass Co-authored-by: Kunpeng Xie <pentaoa@users.noreply.github.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
Improves
sustech-cliUX for agents and headless users based on real usage feedback:Full ISO-8601 schedule timestamps: Personal schedule entries from week-specific queries now include complete
startAt/endAtdatetimes (e.g.2026-09-15T14:00:00+08:00) combining class date with period-based clock times. Agents can answer "this afternoon" queries without reassembling date + time themselves.Date-based schedule queries:
tis schedule --date YYYY-MM-DDresolves the teaching week from the academic calendar automatically, enabling natural queries like "where is class on 2026-09-15?"Structured room fields: When multiple rooms are detected (e.g. "505, 506"), a
roomsarray is populated alongside the primaryroomfield for compatibility.Credential error consistency: Linux encrypted-file backend now produces stable error codes (
MASTER_PASSWORD_REQUIRED,MASTER_PASSWORD_INVALID) with consistent remediation acrossauth status,doctor, and credential reads. No more generic store errors when master password is missing or incorrect.Official period mapping documentation:
docs/ARCHITECTURE.mdnow documents the SUSTech period→clock time mapping as a single source of truth for humans and agents.Changes
Schedule Timestamps (Maintainer Feedback Addressed)
HH:MM--week,--date, or current-week)schedule[]slots lack concrete dates → keep period fields onlyperiodStart/periodEndretained for compatibilityImplementation
enrichScheduleEntriesWithDatetimes()takingteachingStartDate+weekYYYY-MM-DDTHH:MM:SS+08:00--date YYYY-MM-DDontis schedulecommandMASTER_PASSWORD_REQUIRED/INVALIDfrom encrypted store with remediationcredentialStatusReasonCodeto recognize all master password error codesDocumentation
docs/ARCHITECTURE.md: Period mapping table + ISO timestamp behaviordocs/AUTHENTICATION.md: Encrypted-file error codes and remediationCHANGELOG.md: Full summary of all changesFEATURE_DEMO.md: Updated with ISO datetime examplesTesting
Hard constraints met
✅ No new top-level convenience commands added
✅ Existing commands (
tis schedule,auth status,doctor) enriched✅ Backward compatible: period fields retained, new fields are optional/additive
✅ ISO datetimes only for concrete date contexts (personal schedule with week)
✅ Catalog slots keep period-only format (no fake dates)
✅ Tests green, small reviewable PR
✅ FEATURE_DEMO.md kept and updated
Related
Addresses feedback from headless Linux usage and agent query patterns where: