Skip to content

feat(solo/stdlib): date_today() -> ISO YYYY-MM-DD (UTC)#54

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/solo-stdlib-date
May 18, 2026
Merged

feat(solo/stdlib): date_today() -> ISO YYYY-MM-DD (UTC)#54
hyperpolymath merged 1 commit into
mainfrom
feat/solo-stdlib-date

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Third and final Phase-2 stdlib primitive on tracker #45 (Map #49 → JSON #53 → date, this PR).

What

date_today() -> String — current UTC date as ISO YYYY-MM-DD. time() only gave a Unix timestamp float, so there was no way to stamp generated artifacts with a calendar date.

How

Civil date derived from SystemTime epoch seconds via Howard Hinnant's civil_from_days (public domain) — no date-crate dependency, correct for all Gregorian dates. div_euclid handles the (irrelevant-in-practice but correct) pre-epoch case.

Validation

Scope

date_now_iso8601() (mentioned as optional in #45) intentionally deferred — not requested by #48, keeping this PR to one focused primitive. vscode-extension/package-lock.json (pre-existing untracked) not included.

Refs #45
Refs #48

🤖 Generated with Claude Code

time() only yields a Unix timestamp float; tooling that stamps generated
artifacts (changelogs, scaffolds) needs a calendar date. date_today()
returns the current UTC date as an ISO `YYYY-MM-DD` string.

Civil date derived from SystemTime epoch seconds via Howard Hinnant's
civil_from_days algorithm (public domain) — no date-crate dependency,
correct for all Gregorian dates. Verified: produces 2026-05-18 today.

Adds examples/date.my and an integration test asserting format/shape and
a sane range (exact value depends on the wall clock).

Rebased onto main after #49 (Map) and #53 (JSON) landed; coexists with
the map_* / json_* builtins.

Refs #45
Refs #48

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath force-pushed the feat/solo-stdlib-date branch from f0dd493 to 987f5c9 Compare May 18, 2026 09:58
@hyperpolymath hyperpolymath merged commit b576f15 into main May 18, 2026
14 of 15 checks passed
@hyperpolymath hyperpolymath deleted the feat/solo-stdlib-date branch May 18, 2026 09:58
hyperpolymath added a commit that referenced this pull request May 18, 2026
#46/#47/#48 closed and merged via PR #49/#53/#54. The roadmap table
still showed them as Planned / In flight; sync to reality. IMPLEMENTATION.md
already lists them as builtins; this aligns the human-facing roadmap.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 35 issues detected

Severity Count
🔴 Critical 6
🟠 High 11
🟡 Medium 18

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
    "type": "unwrap_dangerous_default",
    "file": "/home/runner/work/my-lang/my-lang/_exploratory/me-scaffolding/crates/parser/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "expect() in hot path (80 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/my-lang/my-lang/_exploratory/me-scaffolding/crates/parser/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (1 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/my-lang/my-lang/my-ssg/src/generator.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "expect() in hot path (5 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/my-lang/my-lang/crates/my-mir/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (26 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/my-lang/my-lang/crates/my-fmt/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (1 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/my-lang/my-lang/crates/my-hir/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (3 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/my-lang/my-lang/crates/my-llvm/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

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.

1 participant