Repository navigation
Conversation
Most free-text cells over their limit were dropped silently: a core driver left null, a dependency skipped, a new pathway's description replaced by the template's, an over-length Pathway Overview ignored. Every limit is now an authoring error, so nothing is written until the workbook is fixed. Limits follow the cookbook (RMI/tpr-tpc#37, decision 0028): - Description 100, Name of publication 200 (new pathways only) - Name of Pathway 200 whole cell, 20 inside the brackets (new pathways only) - Pathway Overview 2,500 - each core driver and dependency description 500 - Scope limitations 500 (already an error; now counted the same way) Length is counted in code points, as the cookbook and JSON-schema maxLength do, on the value as written (after the trailing period is added). Closes #990 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Expected version change and release notes🚨 WARNING: This PR is not expected to trigger a new versionTo trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/ |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-992.westus2.2.azurestaticapps.net |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Target filtering can skip over-length pathway abbreviations before validation, allowing the import to succeed.
1 open finding
What changed in this PR
Makes over-length workbook text block metadata imports instead of being silently dropped, aligning limits with cookbook decision 0028.
Changes:
- Adds shared code-point counting and length validation.
- Applies limits across metadata fields while preserving documented exceptions.
- Adds boundary, punctuation, Unicode, and update-exemption tests.
| File | Description |
|---|---|
| scripts/import-pathway-data.ts | Reports over-length imported text as blocking errors. |
| scripts/import-pathway-data.test.ts | Tests character limits and validation exceptions. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #990.
The metadata importer used to drop most free text that was over its character limit, and the only sign was a line in the report. Now every limit is an authoring error, so nothing is written until the workbook is fixed. The limits are the ones the cookbook now states in RMI/tpr-tpc#37 (decision 0028).
draft_core_drivers› all 7 driversnulldraft_dependencies› all 10 descriptionsdraft_data_availability›Scope limitationsdraft_metadata›Pathway Overviewdraft_metadata›Descriptiondraft_metadata›Name of Pathwaydraft_metadata›Name of publicationWorth knowing
Description,Name of PathwayandName of publicationare checked only for new pathways. An update keeps the name, description and publication already in its JSON and never reads those cells. The cookbook validator (R2.5) still checks them upstream.maxLengthcount them.CO₂is 3 characters and an emoji is 1. JavaScript's.lengthwould count the emoji as 2.schema:checkwould reject anyway. This is one character stricter than the cookbook validator, which measures the raw cell.pathwayDescriptiontaken from an old v1expertOverviewstill only gets a note when it is over 2,500. That text isn't in the workbook, so there's no cell to point the author to.Verification
npx vitest run scripts/import-pathway-data.test.ts: 35 passing. 9 are new and cover each limit at exactly the limit and one over, the added period, code-point counting, and an update with over-length cells that must not error.tsc -p tsconfig.scripts.jsonreports 5 errors in these files, all on unchanged lines and all present onepic/v2before this change.pathway_data_prepared.xlsxand it behaved as expected.🤖 Generated with Claude Code