Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
self-hosted-runner:
labels:
- xcode-27
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
run: make docs-site

build:
runs-on: macos-26
runs-on: xcode-27
timeout-minutes: 20
env:
DEVELOPER_DIR: /Applications/Xcode_26.6.app/Contents/Developer
MACOSX_DEPLOYMENT_TARGET: '14.0'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Swift version
Expand All @@ -51,12 +51,16 @@ jobs:
run: scripts/test-release.sh
- name: Credential-free universal candidate
run: make macos-artifact
- name: Run the universal candidate natively
- name: Run both universal candidate architectures
run: |
arch -x86_64 /usr/bin/true || softwareupdate --install-rosetta --agree-to-license
arch -x86_64 /usr/bin/true
unzip -q dist/remindctl-macos-local.zip -d "$RUNNER_TEMP/remindctl-smoke"
binary="$RUNNER_TEMP/remindctl-smoke/remindctl"
source version.env
test "$(env -u REMINDCTL_VERSION "$binary" --version)" = "$MARKETING_VERSION"
"$binary" --help
test "$(env -u REMINDCTL_VERSION arch -x86_64 "$binary" --version)" = "$MARKETING_VERSION"
arch -x86_64 "$binary" --help
"$binary" completion bash | bash -n
"$binary" completion zsh | zsh -n
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ concurrency:
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# CodeQL Swift tracing does not support macOS 27 yet: https://github.com/github/codeql/issues/22742
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
helper-identifier: ''
linux-archive-name: ''
linux-build-script: ''
macos-runner: macos-26
verify-arm64-runner: macos-26
macos-runner: xcode-27
verify-arm64-runner: xcode-27
minimum-macos-version: 14
macos-build-script: scripts/build-release.sh
prepare-script: ''
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Resolve all-digit reminder ID prefixes when the number is outside the current index range, while preserving valid index precedence. Thanks @goutamadwant.

- Use the shared Swift CLI release workflow for macOS-only signed releases and no-publish rehearsals, replacing the duplicated release pipeline.

- Resolve repeated reminder indexes, IDs, and prefixes once for delete and complete, preserving input order and accurate preview/confirmation counts. Thanks @SebTardif.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Supporting those would require Apple to expose new public APIs or a separate non
## Development

The package manager is pinned in `package.json`, and `.node-version` selects the docs runtime.
CI uses Xcode 26.6 on macOS 26, builds both release architectures, and runs the universal CLI natively.
CI uses the Xcode 27 toolchain on `xcode-27`, builds both release architectures with a macOS 14 deployment target, and runs the universal CLI natively and under Rosetta. Swift CodeQL remains on macOS 26 until its tracer supports macOS 27.
`make check` runs the Swift tests once with coverage and retains the 90% RemindCore gate.
CodeQL scans Swift with an explicit package build after dependency resolution, plus JavaScript/TypeScript and Actions.

Expand Down
9 changes: 5 additions & 4 deletions Sources/RemindCore/IDResolver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ public enum IDResolver {
}
for input in inputs {
let trimmed = input.trimmingCharacters(in: .whitespacesAndNewlines)
if let index = Int(trimmed) {
guard index > 0 && index <= numericSorted.count else {
throw RemindCoreError.invalidIdentifier(trimmed)
}
let numericIndex = Int(trimmed)
if let index = numericIndex, index > 0, index <= numericSorted.count {
appendUnique(numericSorted[index - 1])
continue
}
Expand All @@ -33,6 +31,9 @@ public enum IDResolver {

let matches = sorted.filter { $0.id.lowercased().hasPrefix(trimmed.lowercased()) }
if matches.isEmpty {
if numericIndex != nil {
throw RemindCoreError.invalidIdentifier(trimmed)
}
throw RemindCoreError.reminderNotFound(trimmed)
}
if matches.count > 1 {
Expand Down
49 changes: 49 additions & 0 deletions Tests/RemindCoreTests/IDResolverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,55 @@ struct IDResolverTests {
#expect(resolved.first?.title == "First")
}

@Test("Resolve an out-of-range numeric token as an ID prefix")
func resolveNumericPrefix() throws {
let reminder = ReminderItem(
id: "45534C82-FE4E-4C30-ABE1-2243ED31ACC8",
title: "Numeric prefix",
notes: nil,
isCompleted: false,
completionDate: nil,
priority: .none,
dueDate: nil,
listID: "list1",
listName: "Work"
)

let resolved = try IDResolver.resolve(["4553"], from: [reminder])
#expect(resolved.map(\.id) == [reminder.id])
}

@Test("Keep valid numeric index precedence over an ID prefix")
func validIndexPrecedesNumericPrefix() throws {
let reminders = [
ReminderItem(
id: "0001-prefix",
title: "Prefix match",
notes: nil,
isCompleted: false,
completionDate: nil,
priority: .none,
dueDate: nil,
listID: "list1",
listName: "Work"
),
ReminderItem(
id: "other",
title: "Numeric index",
notes: nil,
isCompleted: false,
completionDate: nil,
priority: .none,
dueDate: nil,
listID: "list1",
listName: "Work"
),
]

let resolved = try IDResolver.resolve(["0001"], from: reminders, numericFrom: [reminders[1]])
#expect(resolved.map(\.id) == [reminders[1].id])
}

@Test("Reject short prefix")
func rejectShortPrefix() {
#expect(throws: RemindCoreError.invalidIdentifier("ab")) {
Expand Down
2 changes: 1 addition & 1 deletion docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The signer never checks out or executes source. Build and verification jobs rece

The shared GitHub release contains `remindctl-macos.zip`, `checksums.txt`, `ASSET-INVENTORY.json`, `SIGNING-MANIFEST.json`, and `RELEASE-NOTES.md`. The ZIP contains only `remindctl`. The inventory records the repository, frozen commit, version tag, dry-run status, archive size, and SHA-256; the signing manifest records the stable identifier `com.steipete.remindctl`, architectures, and Foundation Team ID. The checksum manifest covers every other release asset. Historical releases retain their original `release-inventory.json` schemas; local readers remain for those historical assets.

Both architecture slices must pass strict signature, stable identity, architecture, and online notarization checks. The signer applies hardened runtime and secure timestamps; source metadata validation checks the embedded version inputs, and native execution checks the CLI version and help. Fresh macos-26 arm64 and macos-15-intel runners execute the CLI natively. Standalone Mach-O files cannot be stapled; online `codesign --check-notarization -R=notarized` is the ticket check. CLI version/help smoke does not request Reminders permissions.
Both architecture slices must pass strict signature, stable identity, architecture, and online notarization checks. The signer applies hardened runtime and secure timestamps; source metadata validation checks the embedded version inputs, and execution checks the CLI version and help. Fresh `xcode-27` runners execute arm64 natively and x86_64 under Rosetta, retaining the macOS 14 deployment target. Standalone Mach-O files cannot be stapled; online `codesign --check-notarization -R=notarized` is the ticket check. CLI version/help smoke does not request Reminders permissions.

After publication, the workflow dispatches `steipete/homebrew-tap` with the exact ZIP URL and a unique request ID. It waits for that run and verifies the resulting formula URL and SHA-256. A tap failure leaves the GitHub Release published; repair the tap handoff without republishing the version.

Expand Down
4 changes: 2 additions & 2 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ remindctl edit 4A83 --list-id 7A12
remindctl edit 4A83 --no-repeat
```

`edit`, `complete`, and `delete` accept indexes from the current default listing or ID prefixes.
Numeric indexes must be positive and within the current view; out-of-range values return an error.
Commands that target reminders accept indexes from the current default listing or ID prefixes.
An in-range numeric value always selects that index. An out-of-range numeric value falls back to ID-prefix matching and returns an error when no reminder ID matches.
`complete` and `delete` process each reminder once, even when repeated indexes, IDs, or prefixes identify the same reminder. Previews and delete confirmation counts use these unique targets in first-input order; every input must still be valid and unambiguous.
Reminders sort by due date, then title, then stable ID so equal dates and titles do not make numeric targets depend on EventKit's fetch order. Use IDs when reminders may be added, removed, or edited between commands.

Expand Down
4 changes: 1 addition & 3 deletions scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
set -euo pipefail
: "${OUTPUT_DIR:?OUTPUT_DIR is required}"
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
candidate=$(find /Applications -maxdepth 1 -name 'Xcode_26*.app' | sort -V | tail -1)
[[ -n "$candidate" ]] || { echo 'Xcode 26 is required' >&2; exit 1; }
export DEVELOPER_DIR="$candidate/Contents/Developer"
export MACOSX_DEPLOYMENT_TARGET=14.0
mkdir -p "$OUTPUT_DIR"
"$ROOT/scripts/build-macos-universal.sh" "$OUTPUT_DIR/remindctl"
chmod +x "$OUTPUT_DIR/remindctl"
11 changes: 8 additions & 3 deletions scripts/test-release-caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,19 @@ def test_output_directory_adapter(self):
(root / 'tools').mkdir()
shutil.copy(ROOT / 'scripts/build-release.sh', root / 'scripts/build-release.sh')
builder = root / 'scripts/build-macos-universal.sh'
builder.write_text('#!/bin/bash\nset -eu\nprintf "synthetic" > "$1"\n')
builder.write_text('#!/bin/bash\nset -eu\n'
'test "$DEVELOPER_DIR" = "/Applications/Xcode_27.app/Contents/Developer"\n'
'test "$MACOSX_DEPLOYMENT_TARGET" = "14.0"\n'
'printf "synthetic" > "$1"\n')
builder.chmod(0o755)
find = root / 'tools/find'
find.write_text('#!/bin/bash\necho /Applications/Xcode_26.6.app\n')
find.write_text('#!/bin/bash\necho "Unexpected Xcode discovery" >&2\nexit 1\n')
find.chmod(0o755)
output = root / 'output with spaces'
subprocess.run([str(root / 'scripts/build-release.sh')], check=True,
env=dict(os.environ, OUTPUT_DIR=str(output), PATH=str(root / 'tools') + ':' + os.environ['PATH']))
env=dict(os.environ, OUTPUT_DIR=str(output),
DEVELOPER_DIR='/Applications/Xcode_27.app/Contents/Developer',
PATH=str(root / 'tools') + ':' + os.environ['PATH']))
binary = output / BINARY
self.assertEqual(binary.read_text(), 'synthetic')
self.assertTrue(os.access(binary, os.X_OK))
Expand Down
Loading