Skip to content

Document vm_today and datetime support in calculated fields#1167

Merged
nrichers merged 15 commits intomainfrom
sc-7465/vm-today-datetime-constant
Mar 17, 2026
Merged

Document vm_today and datetime support in calculated fields#1167
nrichers merged 15 commits intomainfrom
sc-7465/vm-today-datetime-constant

Conversation

@nrichers
Copy link
Copy Markdown
Collaborator

@nrichers nrichers commented Feb 10, 2026

Summary of changes

  • New collapsible example for date arithmetic and vm_today — now in its own include file _example-next-review-date-and-days-remaining.qmd, included under the "Add inventory fields" tab.
  • Table of names available in formulas: vm_today, date, datetime, timedelta, relativedelta.
  • Two example formulas:
    1. Next review date — Approval date + interval by risk tier (Tier 1: +3 months, Tier 2: +6 months, Tier 3: +1 year).
    2. Days remaining — Countdown to next review using vm_today.
  • Heading fix: "Inventory field types" promoted to h3, positioned as reference for the entire "Add or edit inventory fields" section.
  • Two new screenshots showing calculation field configuration.

Note: The vm_today example in this PR should be an improvement over the original gist by computing a countdown. The gist's simple.md didn't demonstrate vm_today, it just calculated the next review date using relativedelta.

Files changed

  • site/guide/model-inventory/_example-next-review-date-and-days-remaining.qmd (new)
  • site/guide/model-inventory/_add-edit-inventory-fields.qmd (include added)
  • site/guide/model-inventory/manage-model-inventory-fields.qmd (heading level fix)
  • site/guide/model-inventory/calculation-field-*.png (new screenshots)

Findings from codebase investigation

  • Backend (backend/src/backend/utils/code_executor.py): Execution environment injects vm_today = date.today() and exposes date, datetime, timedelta, relativedelta (and others) into formula scope. Date fields are passed as values that require int(params.x) / 1000 for date.fromtimestamp() (JS/Python timestamp precision difference).
  • Feature history: Implemented in Sprint 63 (Nov 2024), backend PR PR#1003 — Merge main into staging PR#1003 — Merge main into staging #1004, frontend PR docs: Show model stakeholder updates in model activity docs: Show model stakeholder updates in model activity #1078. Held from release notes then; dev confirmed ready to document now.
  • No library notebooks reference this — it is a platform UI feature for inventory calculated fields only.
  • Reference: Andres's gist (complex + simple examples) and demo transcript (days-remaining countdown use of vm_today).

[sc-7465]

How to test

Check "Example — Next review date & days remaining" in the live preview: Add or edit inventory fields

Capto_ 2026-03-13_08-03-40_pm

@nrichers nrichers added the internal Not to be externalized in the release notes label Feb 10, 2026
Add collapsible example for date arithmetic in model inventory
calculation fields: vm_today, date, datetime, timedelta, relativedelta.
Includes next review date and days-remaining countdown examples.
Notes timestamp input and string output behavior.

[sc-7465]
@nrichers nrichers force-pushed the sc-7465/vm-today-datetime-constant branch from 5f917e9 to 35ddc67 Compare February 10, 2026 23:13
@claude
Copy link
Copy Markdown

claude Bot commented Feb 10, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@nrichers
Copy link
Copy Markdown
Collaborator Author

Note on commit a292106:

"Inventory field types" was incorrectly nested as an h4 under "Rename custom field keys," implying it only applied to renaming. It's actually general reference material for the entire "Add or edit inventory fields" section.

This commit promotes it to h3 and moves it before "Rename custom field keys" so it's properly positioned as reference for anyone adding or editing fields.

@github-actions
Copy link
Copy Markdown
Contributor

Lighthouse check results

⚠️ WARN: Average accessibility score is 0.87 (required: >0.9) — Check the workflow run

Show Lighthouse scores

Folder depth level checked: 0

Commit SHA: 2eba7ac

Modify the workflow to check a different depth:

  • 0: Top-level navigation only — /index.html, /guide/guides.html, ...
  • 1: All first-level subdirectories — /guide/.html, /developer/.html, ...
  • 2: All second-level subdirectories — /guide/attestation/*.html, ...
Page Accessibility Performance Best Practices SEO
/developer/validmind-library.html 0.85 0.68 1.00 0.82
/get-started/get-started.html 0.85 0.74 1.00 0.73
/guide/guides.html 0.85 0.69 1.00 0.82
/index.html 0.93 0.68 1.00 0.82
/releases/all-releases.html 0.86 0.69 1.00 0.73
/support/support.html 0.91 0.66 1.00 0.82
/training/training.html 0.85 0.62 0.96 0.73

@nrichers nrichers requested review from cachafla and validbeck March 14, 2026 03:11
@validbeck
Copy link
Copy Markdown
Collaborator

Not sure why the preview workflow isn't working, but (taking a look at the content now, just wanted to flag the weird error as your PR doesn't touch that file 🤔 ... issue with the newer version of Quarto?):

[ 13/675] developer/how-to/feature-overview.qmd
Warning: couldn't recognize format, using default tabset rendering

Comment thread site/guide/model-inventory/manage-model-inventory-fields.qmd Outdated
@nrichers
Copy link
Copy Markdown
Collaborator Author

Not sure why the preview workflow isn't working, but (taking a look at the content now, just wanted to flag the weird error as your PR doesn't touch that file 🤔 ... issue with the newer version of Quarto?):

[ 13/675] developer/how-to/feature-overview.qmd
Warning: couldn't recognize format, using default tabset rendering

This is a common warning when rendering Quarto Markdown to plain Markdown. It's an expected warning, as there's no .tabset equivalent, and you'll see a bunch more of these when you render locally.

@nibalizer the "Validate LLM markdown render" step in recent workflow runs never finishes and the runs time out. Not sure what it's choking on but it might be [ 15/675] developer/how-to/testing-overview.qmd. No warnings, the step just sits there. That topic does contain a .tabset with a couple of Whizgraph diagrams but the stuff renders fine locally.

@nrichers nrichers requested a review from validbeck March 17, 2026 19:47
@nibalizer
Copy link
Copy Markdown
Contributor

Weird

@github-actions
Copy link
Copy Markdown
Contributor

PR Summary

This PR enhances the documentation for inventory and artifact fields by adding a detailed example for calculating the next review date and the days remaining until the next review. The new example guides users through creating fields that take an approved date and validation frequency as inputs, apply a tier-based adjustment via a custom risk tier calculation, and then dynamically calculate and display the next review date and remaining days until review. The changes include:

  • A new example file (_example-next-review-date-and-days-remaining.qmd) demonstrating the use of date manipulation using Python's datetime, timedelta, and dateutil.relativedelta libraries.
  • Incorporation of the new example into the model inventory guide by including it with a shortcode call.
  • Adjustments in the field types and artifact fields documentation to reference the updated examples consistently.

The documentation now provides a practical use case for combining calculation fields to automatically track review schedules, helping users implement and test dynamic model inventory fields.

Test Suggestions

  • Verify that the new example page renders correctly in the documentation site and that all images (screenshots) are displayed properly.
  • Run through the provided code examples in a local environment to ensure that the Python code snippets execute without errors.
  • Check that the inclusion of the new guide via the shortcode ({{< include /guide/model-inventory/_example-next-review-date-and-days-remaining.qmd >}}) works as expected, and the content is correctly embedded in the inventory and artifact field documentation.
  • Ensure consistency in naming and formatting across the modified documentation files.

@github-actions
Copy link
Copy Markdown
Contributor

Validate docs site

✓ INFO: A live preview of the docs site is available — Open the preview

@nrichers nrichers merged commit 284cdd6 into main Mar 17, 2026
10 of 12 checks passed
@nrichers nrichers deleted the sc-7465/vm-today-datetime-constant branch March 17, 2026 23:13
nrichers added a commit that referenced this pull request Mar 24, 2026
* Expand custom artifact type content

* Add margin footnote link

* Change to definition list

* Edits

* docs: Organization wide default tracking changes in content blocks  (#1202)

* Edit: Managing your organization

* WIP: Collaborate with others > Tracking changes

* Edit: Collaborate with others > Tracking changes

* Proofread

* docs: Insert inventory & artifact field values as variables into documents & library blocks (#1207)

* Save point

* Save point

* Work with content blocks > Reference field values

* Single-source prep

* Editing

* Save point

* Save point

* Save point

* Edit

* Editing...

* New content editing toolbar image

* Missing copyrights

* docs: Individual model inventory field activity (#1206)

* WIP: View model activity > Filter all model activity

* Save point

* View model activity: View individual model field activity

* Save point

* Save point

* Save point

* Proofreading

* Proofreading again

* Typo

* Update site/guide/model-inventory/edit-model-inventory-fields.qmd

Co-authored-by: Nik Richers <nik@validmind.ai>

* Fixing numbering

* Fixing indenting

---------

Co-authored-by: Nik Richers <nik@validmind.ai>

* feat: docs pipeline to render markdown

* feat: bump quarto to pre-release

* chore: run llm gen at the end so we don't delay pr previews

* LUA filter + Pandoc post-processing experiment

* docs: 'document' parameter in `vm.init()` for model document target (#1211)

* WIP

* Save point

* Save point

* Save point

* Edit: Install & initialize the ValidMind Library

* Cursor WIP

* Save point

* Save point

* Save point

* Save point

* Save point

* Store model credentials in env files

* What's next

* Updating notebook listing scripts for page-size: 4

* Save point

* Quick edit

* One more

* and another

* Hang on forgot training stuff

* Updated get started

* Updated enable monitoring

* Training updated

* copyright

* Missed a module

* feat: make llm publishing slimmer- no release no installation no library

* chore: put vm-library llm docs back

* Switch to sparse checkout for some repos

* fix: errors in publish llm gha

* chore: handle the case where branch name is not main or prod, for instance when testing

* Add "Quick reference" section to test overview page (#1205)

* Add key concepts section to test overview page

* Make section a callout, change to quick reference

* Save point for graphviz

* Some graphviz tweaks

* A few more tweaks

* Fill colour tweak

* Document vm_today and datetime support in calculated fields (#1167)

* Document vm_today and datetime support in calculated fields

Add collapsible example for date arithmetic in model inventory
calculation fields: vm_today, date, datetime, timedelta, relativedelta.
Includes next review date and days-remaining countdown examples.
Notes timestamp input and string output behavior.

[sc-7465]

* Fix whitespace

* Fix heading level and move inventory field types up one section

* Add screenshots, edits after testing

* Save point before moving content

* Move into its own file and relocate

* Better intro

* Restore better vm_today example

* Edits

* Minor text reschuffle

* Mention fields by name

* Move field types reference content below prequisites and bump to h2

* Fix example casing

* Consistency edit

* Rename and restructure Supported Models page (#1163)

* Rename and restructure Supported Models page

- Rename supported-models.qmd to supported-model-frameworks.qmd
- Add alias for old URL to preserve links
- Restructure content into clearer sections:
  - Framework support with wrapper classes and install commands
  - Test input requirements (predict vs predict_proba)
  - Custom model wrappers (FunctionModel, PipelineModel)
  - GenAI and LLM support
  - RAG evaluation with RAGAS
  - Python and dependency compatibility
- Add Mermaid diagrams for class hierarchy and test input flow
- Update references in faq-integrations.qmd and overview-model-documentation.qmd

* Fix missed sidebar update

* Fix broken link

* Add bridging sentence after callout

* Re-add a what does supported mean heading

* Minor edit

* Re-add some old goodness

* Much better detail

* Edits

* More edits

* Edits

* Remove old supported models page

* Minor edit

* Edits

* File rename again

* Remove duplicated embeddings content

* Uncomment and move info about tests for text-generating models

* Update site/developer/supported-models-and-frameworks.qmd

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>

* Update site/developer/supported-models-and-frameworks.qmd

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>

* Update site/developer/supported-models-and-frameworks.qmd

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>

* Update site/developer/supported-models-and-frameworks.qmd

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>

* Update site/developer/supported-models-and-frameworks.qmd

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>

* Switch to definition list after removing lead-in text for bulleted list

* Two columns for a neater layout

* Remove pointless link

* Add links, text edits

* Update site/developer/supported-models-and-frameworks.qmd

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>

* Whitespace

* Address review comment from Juan

* Remove links I'd added

---------

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>

* docs: Updated document type names (#1224)

* WIP

* WIP

* Editing validation report template def

* Edit...

* Glossary / about updated

* FAQ updated

* Quickstart -screenshots updated

* Work with test results done

* Enable monitoring done

* Review monitoring results done

* Work with metrics over time done

* save point

* save point

* Editing Export documents

* Export documents done

* Glossary proofreading

* Save point

* Save point

* Save point

* Save point

* Save point

* Save point

* Save point

* Save point

* Edit Manage document types

* Edit Manage model documents

* Edit Customize document templates

* Edit Manage document templates

* Edit Export documents

* Edit

* Edit

* Quickstart - Register a model

* Quickstart - Select a template

* Quickstart - Work with {document}

* Proofread

* Pulling in latest notebooks

* Removing unused page

* Removing backup screenshots

* Revert "Removing unused page"

This reverts commit 9a710fd.

* Revering a change that didn't make sense

* Updating notebooks again

* edit

* docs: Delete and archive artifact types (#1228)

* WIP

* WIP

* Edit: Manage artifact types

* Edit

* Edit after Slack convo

* Add R support documentation (#1227)

* Initial draft

* Add more install info

* Add quickstarts

* Grouping install & initalize in sidebar

* Silly sidebar variable quirk

---------

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>

* Switch to RELEASE_NOTES_RO_PAT for installation repo (#1231)

* Fix CI hang: Don't try to render Graphviz diagrams with GFM (#1230)

* Add pandoc install step

* Try chromium install since stuff renders fine locally

* Switch to RELEASE_NOTES_RO_PAT for installation repo

* Try images instead of Graphviz

* Add render-llm make action for local testing

* Remove Chromium install steps

* BG transparency

---------

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>

* Add auto-generated template schema documentation (#1166)

* Add auto-generated template schema documentation

- Create generate_template_schema_docs.py script to generate HTML schema
  docs from backend JSON Schema using json-schema-for-humans
- Update customize-document-templates.qmd to use generated include
- Add template schema and permissions documentation sections to README.md

The template schema is now regenerated from the v5 JSON schema in the
backend repo, replacing the outdated hardcoded HTML.

Closes sc-6164

* Switch to {html} codeblock, move styles into separate file, style tweaks

* Fixed whitespace issue and added rounded corners

* Fix heading level

* Delete generated template schema file

* Add make action and move template schema docs generation into workflows

* Minor edit

* Fix style for No Additional Items badges

* Kibosh wayward ellipsis

* Remove permissions documentation section from my other PR

* Strip out schema doc CSS that causes issues, style tweaks

* Move expand and collapse buttons above first accordion

* Smidgen of whitespace before embed

* Add README.md section of required repos, remove old R info

* Temporarily add Andres' branch ref

* Switch to new UI schema JSON

* Remove temporary branch ref

* docs: Export analytics (#1225)

* Setup: Export analytics

* WIP

* edit

* Proofreading

---------

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Spencer Krum <nibz@validmind.ai>
nrichers added a commit that referenced this pull request Mar 25, 2026
* Expand custom artifact type content

* Add margin footnote link

* Change to definition list

* Edits

* docs: Organization wide default tracking changes in content blocks  (#1202)

* Edit: Managing your organization

* WIP: Collaborate with others > Tracking changes

* Edit: Collaborate with others > Tracking changes

* Proofread

* docs: Insert inventory & artifact field values as variables into documents & library blocks (#1207)

* Save point

* Save point

* Work with content blocks > Reference field values

* Single-source prep

* Editing

* Save point

* Save point

* Save point

* Edit

* Editing...

* New content editing toolbar image

* Missing copyrights

* docs: Individual model inventory field activity (#1206)

* WIP: View model activity > Filter all model activity

* Save point

* View model activity: View individual model field activity

* Save point

* Save point

* Save point

* Proofreading

* Proofreading again

* Typo

* Update site/guide/model-inventory/edit-model-inventory-fields.qmd



* Fixing numbering

* Fixing indenting

---------



* feat: docs pipeline to render markdown

* feat: bump quarto to pre-release

* chore: run llm gen at the end so we don't delay pr previews

* LUA filter + Pandoc post-processing experiment

* docs: 'document' parameter in `vm.init()` for model document target (#1211)

* WIP

* Save point

* Save point

* Save point

* Edit: Install & initialize the ValidMind Library

* Cursor WIP

* Save point

* Save point

* Save point

* Save point

* Save point

* Store model credentials in env files

* What's next

* Updating notebook listing scripts for page-size: 4

* Save point

* Quick edit

* One more

* and another

* Hang on forgot training stuff

* Updated get started

* Updated enable monitoring

* Training updated

* copyright

* Missed a module

* feat: make llm publishing slimmer- no release no installation no library

* chore: put vm-library llm docs back

* Switch to sparse checkout for some repos

* fix: errors in publish llm gha

* chore: handle the case where branch name is not main or prod, for instance when testing

* Add "Quick reference" section to test overview page (#1205)

* Add key concepts section to test overview page

* Make section a callout, change to quick reference

* Save point for graphviz

* Some graphviz tweaks

* A few more tweaks

* Fill colour tweak

* Document vm_today and datetime support in calculated fields (#1167)

* Document vm_today and datetime support in calculated fields

Add collapsible example for date arithmetic in model inventory
calculation fields: vm_today, date, datetime, timedelta, relativedelta.
Includes next review date and days-remaining countdown examples.
Notes timestamp input and string output behavior.

[sc-7465]

* Fix whitespace

* Fix heading level and move inventory field types up one section

* Add screenshots, edits after testing

* Save point before moving content

* Move into its own file and relocate

* Better intro

* Restore better vm_today example

* Edits

* Minor text reschuffle

* Mention fields by name

* Move field types reference content below prequisites and bump to h2

* Fix example casing

* Consistency edit

* Rename and restructure Supported Models page (#1163)

* Rename and restructure Supported Models page

- Rename supported-models.qmd to supported-model-frameworks.qmd
- Add alias for old URL to preserve links
- Restructure content into clearer sections:
  - Framework support with wrapper classes and install commands
  - Test input requirements (predict vs predict_proba)
  - Custom model wrappers (FunctionModel, PipelineModel)
  - GenAI and LLM support
  - RAG evaluation with RAGAS
  - Python and dependency compatibility
- Add Mermaid diagrams for class hierarchy and test input flow
- Update references in faq-integrations.qmd and overview-model-documentation.qmd

* Fix missed sidebar update

* Fix broken link

* Add bridging sentence after callout

* Re-add a what does supported mean heading

* Minor edit

* Re-add some old goodness

* Much better detail

* Edits

* More edits

* Edits

* Remove old supported models page

* Minor edit

* Edits

* File rename again

* Remove duplicated embeddings content

* Uncomment and move info about tests for text-generating models

* Update site/developer/supported-models-and-frameworks.qmd



* Update site/developer/supported-models-and-frameworks.qmd



* Update site/developer/supported-models-and-frameworks.qmd



* Update site/developer/supported-models-and-frameworks.qmd



* Update site/developer/supported-models-and-frameworks.qmd



* Switch to definition list after removing lead-in text for bulleted list

* Two columns for a neater layout

* Remove pointless link

* Add links, text edits

* Update site/developer/supported-models-and-frameworks.qmd



* Whitespace

* Address review comment from Juan

* Remove links I'd added

---------



* docs: Updated document type names (#1224)

* WIP

* WIP

* Editing validation report template def

* Edit...

* Glossary / about updated

* FAQ updated

* Quickstart -screenshots updated

* Work with test results done

* Enable monitoring done

* Review monitoring results done

* Work with metrics over time done

* save point

* save point

* Editing Export documents

* Export documents done

* Glossary proofreading

* Save point

* Save point

* Save point

* Save point

* Save point

* Save point

* Save point

* Save point

* Edit Manage document types

* Edit Manage model documents

* Edit Customize document templates

* Edit Manage document templates

* Edit Export documents

* Edit

* Edit

* Quickstart - Register a model

* Quickstart - Select a template

* Quickstart - Work with {document}

* Proofread

* Pulling in latest notebooks

* Removing unused page

* Removing backup screenshots

* Revert "Removing unused page"

This reverts commit 9a710fd.

* Revering a change that didn't make sense

* Updating notebooks again

* edit

* docs: Delete and archive artifact types (#1228)

* WIP

* WIP

* Edit: Manage artifact types

* Edit

* Edit after Slack convo

* Add R support documentation (#1227)

* Initial draft

* Add more install info

* Add quickstarts

* Grouping install & initalize in sidebar

* Silly sidebar variable quirk

---------



* Switch to RELEASE_NOTES_RO_PAT for installation repo (#1231)

* Fix CI hang: Don't try to render Graphviz diagrams with GFM (#1230)

* Add pandoc install step

* Try chromium install since stuff renders fine locally

* Switch to RELEASE_NOTES_RO_PAT for installation repo

* Try images instead of Graphviz

* Add render-llm make action for local testing

* Remove Chromium install steps

* BG transparency

---------



* Add auto-generated template schema documentation (#1166)

* Add auto-generated template schema documentation

- Create generate_template_schema_docs.py script to generate HTML schema
  docs from backend JSON Schema using json-schema-for-humans
- Update customize-document-templates.qmd to use generated include
- Add template schema and permissions documentation sections to README.md

The template schema is now regenerated from the v5 JSON schema in the
backend repo, replacing the outdated hardcoded HTML.

Closes sc-6164

* Switch to {html} codeblock, move styles into separate file, style tweaks

* Fixed whitespace issue and added rounded corners

* Fix heading level

* Delete generated template schema file

* Add make action and move template schema docs generation into workflows

* Minor edit

* Fix style for No Additional Items badges

* Kibosh wayward ellipsis

* Remove permissions documentation section from my other PR

* Strip out schema doc CSS that causes issues, style tweaks

* Move expand and collapse buttons above first accordion

* Smidgen of whitespace before embed

* Add README.md section of required repos, remove old R info

* Temporarily add Andres' branch ref

* Switch to new UI schema JSON

* Remove temporary branch ref

* docs: Export analytics (#1225)

* Setup: Export analytics

* WIP

* edit

* Proofreading

---------

Co-authored-by: Beck <164545837+validbeck@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Spencer Krum <nibz@validmind.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Not to be externalized in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants