Skip to content

PR-17: migrate time core to v2 (#454)#517

Open
charliecreates[bot] wants to merge 1 commit intocharlie/issue-454-v2-pr17-migrate-ids-names-v2from
charlie/issue-454-v2-pr18-migrate-time-core-v2
Open

PR-17: migrate time core to v2 (#454)#517
charliecreates[bot] wants to merge 1 commit intocharlie/issue-454-v2-pr17-migrate-ids-names-v2from
charlie/issue-454-v2-pr18-migrate-time-core-v2

Conversation

@charliecreates
Copy link
Contributor

Stack step PR-17 in the issue #454 migration chain.

@github-actions
Copy link

orrery preview: https://pr-517.orrery-c4f.pages.dev/

Copy link
Contributor Author

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The v2 migration looks mechanically consistent, but contract.result is currently an empty object schema everywhere, which is likely incorrect for many of these methods and can undermine validation/comparison in the v2 harness. Comparison defaults are applied inconsistently (et2utc missing) and inappropriately for methods that return strings (e.g., spiceVersion, tkvrsn, timout), which can mask real mismatches or create misleading specs.

Summary of changes

Summary

Migrates parity-checking time method specs from @v1 to @v2 schema across multiple methods.

What changed

  • Replaced legacy v1 spec format (id/kind/contractMethod/.../uses/cases) with v2 structure:
    • schemaVersion: 2
    • manifest (id, kind)
    • contract (contractMethod, canonicalMethod, aliases, result)
    • setup.kernels: [$FIXTURES/basic-time]
    • workflow.steps: [{ op: invokeLegacyCall }]
    • Optional defaults.compare tolerances (tolAbs, tolRel) added to most specs
  • Files affected:
    • Deleted and re-added as v2: deltet, spiceVersion, str2et, timdef, timout, tkvrsn, tparse, tpictr, unitim
    • Renamed et2utc@v1.ymlet2utc@v2.yml and updated content to v2 schema

Notable behavioral/config changes

  • Introduced global default numeric comparison tolerances (1e-12) for most methods.
  • et2utc@v2.yml does not include defaults.compare while others do.

Comment on lines +5 to +11
contract:
contractMethod: time.deltet
canonicalMethod: time.deltet
aliases: []
result:
type: object
properties: {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contract.result is defined as an empty object schema (type: object with empty properties). For several of these methods (e.g., time.deltet, time.unitim, time.str2et, time.timout), the return is typically a scalar/primitive (number or string) rather than an object. If the v2 runner uses contract.result to drive decoding/validation/comparison, this can cause false positives/negatives or skip meaningful result assertions.

Suggestion

Define contract.result to match the actual return shape for the method (e.g., type: number/type: string/tuple-like array/object with explicit properties), or omit result if the v2 schema supports that and the harness infers it. Example for numeric return:

contract:
  contractMethod: time.deltet
  canonicalMethod: time.deltet
  aliases: []
  result:
    type: number

Reply with "@CharlieHelps yes please" if you'd like me to add a commit updating the result schemas across these time specs consistently.

Comment on lines +1 to +17
schemaVersion: 2
manifest:
id: methods/time/et2utc@v2
kind: method
contract:
contractMethod: time.et2utc
canonicalMethod: time.et2utc
aliases: []
result:
type: object
properties: {}
setup:
kernels:
- $FIXTURES/basic-time
workflow:
steps:
- op: invokeLegacyCall
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most v2 specs add defaults.compare.tolAbs/tolRel, but this one doesn’t. That inconsistency can lead to different comparison behavior across methods and flaky parity checks when floating-point outputs are involved (even if this particular case currently only asserts ok: false).

Suggestion

Either add the same defaults.compare block here for consistency, or explicitly document/encode why et2utc is intentionally different (e.g., it returns strings and should be compared exactly). If et2utc returns a string, consider setting a string-appropriate compare strategy instead of numeric tolerances. Reply with "@CharlieHelps yes please" if you'd like me to add a commit to align et2utc@v2.yml with the other v2 time specs.

Comment on lines +15 to +18
defaults:
compare:
tolAbs: 1e-12
tolRel: 1e-12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applying numeric tolerances (tolAbs/tolRel) globally to a method that returns a version string risks masking real mismatches if the compare layer mistakenly treats outputs numerically/coercively or applies tolerance logic broadly. Even if the harness is smart, this is an easy footgun for future changes.

Suggestion

Remove defaults.compare for methods that return strings (like time.spiceVersion), or switch to an explicit string comparison mode if supported by the spec schema (e.g., exact match). Reply with "@CharlieHelps yes please" if you'd like me to add a commit removing/adjusting tolerances for string-returning time methods.

Comment on lines +15 to +18
defaults:
compare:
tolAbs: 1e-12
tolRel: 1e-12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same concern as above: defaults.compare numeric tolerances don’t make sense for time.timout, which is expected to return a formatted time string. Keeping tolerances here can hide comparison configuration errors and makes intent unclear.

Suggestion

Drop defaults.compare.tolAbs/tolRel for time.timout@v2 (string result) or replace it with a string/exact compare configuration if the framework supports it. Reply with "@CharlieHelps yes please" if you'd like me to add a commit making this change.

Comment on lines +15 to +18
defaults:
compare:
tolAbs: 1e-12
tolRel: 1e-12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaults.compare numeric tolerances on time.tkvrsn (version string) has the same mismatch risk and makes the spec misleading about what is being compared.

Suggestion

Remove numeric tolerances for time.tkvrsn@v2 or configure string comparison explicitly. Reply with "@CharlieHelps yes please" if you'd like me to add a commit adjusting this spec.

@charliecreates charliecreates bot removed the request for review from CharlieHelps February 22, 2026 18:29
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