Skip to content

Improve schedule UX with time semantics and credential error consistency - #23

Merged
pentaoa merged 4 commits into
mainfrom
cursor/ux-improvements-715e
Sep 18, 2026
Merged

pentaoa merged 4 commits into
mainfrom
cursor/ux-improvements-715e

Conversation

@pentaoa

@pentaoa pentaoa commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Improves sustech-cli UX for agents and headless users based on real usage feedback:

  1. Full ISO-8601 schedule timestamps: Personal schedule entries from week-specific queries now include complete startAt/endAt datetimes (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.

  2. Date-based schedule queries: tis schedule --date YYYY-MM-DD resolves the teaching week from the academic calendar automatically, enabling natural queries like "where is class on 2026-09-15?"

  3. Structured room fields: When multiple rooms are detected (e.g. "505, 506"), a rooms array is populated alongside the primary room field for compatibility.

  4. Credential error consistency: Linux encrypted-file backend now produces stable error codes (MASTER_PASSWORD_REQUIRED, MASTER_PASSWORD_INVALID) with consistent remediation across auth status, doctor, and credential reads. No more generic store errors when master password is missing or incorrect.

  5. Official period mapping documentation: docs/ARCHITECTURE.md now documents the SUSTech period→clock time mapping as a single source of truth for humans and agents.

Changes

Schedule Timestamps (Maintainer Feedback Addressed)

  • ✅ Full ISO-8601 datetimes instead of bare HH:MM
  • ✅ Only week-specific personal schedule queries get timestamps (via --week, --date, or current-week)
  • ✅ Catalog schedule[] slots lack concrete dates → keep period fields only
  • ✅ Enrichment happens in CLI layer with calendar context
  • periodStart/periodEnd retained for compatibility

Implementation

  • Add enrichScheduleEntriesWithDatetimes() taking teachingStartDate + week
  • Calculate concrete date for each entry based on teaching week + weekday
  • Generate full Asia/Shanghai ISO-8601 timestamps: YYYY-MM-DDTHH:MM:SS+08:00
  • Only enrich entries scheduled for the query week
  • Support --date YYYY-MM-DD on tis schedule command
  • Parse multiple rooms from comma/semicolon-separated room strings
  • Throw MASTER_PASSWORD_REQUIRED/INVALID from encrypted store with remediation
  • Update credentialStatusReasonCode to recognize all master password error codes

Documentation

  • docs/ARCHITECTURE.md: Period mapping table + ISO timestamp behavior
  • docs/AUTHENTICATION.md: Encrypted-file error codes and remediation
  • CHANGELOG.md: Full summary of all changes
  • FEATURE_DEMO.md: Updated with ISO datetime examples

Testing

  • All 474 tests pass
  • 6 new tests for schedule enrichment, timestamps, room parsing
  • Fixed bitmap week parsing test data

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:

  • "where is class this afternoon?" required both date lookup and period math
  • Master password errors showed as generic store failures without clear remediation
  • Multiple lab rooms in descriptions were unparseable
  • Bare clock times needed date reassembly for datetime comparisons
Open in Web Open in Cursor 

cursoragent and others added 4 commits September 18, 2026 05:49
…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>
@pentaoa
pentaoa marked this pull request as ready for review September 18, 2026 08:12
@pentaoa
pentaoa merged commit be53f54 into main Sep 18, 2026
6 checks passed
@pentaoa
pentaoa deleted the cursor/ux-improvements-715e branch September 18, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants