@diplodoc-platform/translation
ACommon rules and standards
Install
agr install @diplodoc-platform/translation --target codexWrites 1 file into AGENTS.md, pinned to git-5cb461ca.
- AGENTS.md
Document
Common rules and standards
This package is a submodule in the Diplodoc metapackage. When working in metapackage mode, also follow:
../../.agents/style-and-testing.md— code style, import organization, testing, English-only docs/comments/commit messages../../.agents/monorepo.md— workspace vs standalone dependency management (--no-workspaces)../../.agents/dev-infrastructure.md— infrastructure update recipes and CI conventions
Project description
@diplodoc/translation provides utilities for extracting translatable content from Markdown (and some structured formats) into XLIFF plus a “skeleton”, and composing translated content back.
Primary entry points:
extract(...)/compose(...)— high-level API (src/api/)- JSON ref helpers —
linkRefs(...)/unlinkRefs(...)(src/json/) - Directives —
noTranslate(src/directives/)
Structure
src/— sourceslib/— build output (generated)schemas/— published schemasesbuild/— bundling configuration (Node target)scripts/— small maintenance scripts (cross-platform)
Development commands
npm run typecheck
npm test
npm run lint
npm run build
Dependency management (submodule rules)
When adding/updating dependencies inside this submodule, keep standalone mode working:
npm install --no-workspaces <pkg>
npm install --no-workspaces --package-lock-only
Testing
- Framework: Vitest
- Tests live next to implementation as
*.spec.ts - Snapshots are stored in
__snapshots__/
Run tests:
npm test
Trustgrade A
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- passLicense
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.
Versions
git-5cb461caee302026-08-06