Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ It auto-deploys via GitHub Actions on every push to `main` that touches
- **[Feature audit](docs/src/content/docs/reference/features.md)** — every feature, its status, and where to find it
- **[API reference](docs/src/content/docs/reference/api.md)** — key classes and methods
- **[Validator rules](docs/src/content/docs/reference/validator-rules.md)** — R01–R16 catalogue
- **[TODO.impl/](TODO.impl/)** — engineering plans, audit findings, open questions

## Examples

Expand Down
1 change: 0 additions & 1 deletion docs/src/content/docs/reference/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ db2 = Opencdd::Database.load("out.xlsx")
db2.entities.size # => 20 (only classes; properties + value_lists lost)
```

Tracked in [TODO.impl/16-audit-findings.md](https://github.com/opencdd/opencdd-ruby/blob/main/TODO.impl/16-audit-findings.md).
Pending fix is the row→Hash conversion in `Sheet.from_rows` when the
sheet has no Workbook context.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/reference/validator-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ be acyclic. Uses `Opencdd::EffectiveProperties` for traversal.

### R16 — CLASS_REFERENCE target validation

Added in audit round 2 ([see A20](https://github.com/opencdd/opencdd-ruby/blob/main/TODO.impl/16-audit-findings.md)).
Added in audit round 2.

When a property's data type is `CLASS_REFERENCE(CategoricalClass)`,
the value IRDI must resolve to an entity that is a valid powertype
Expand Down
2 changes: 1 addition & 1 deletion lib/opencdd/cddal/value_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Opencdd
module Cddal
# Pure-function value serializer: converts AST value nodes into
# the CDDAL/Parcel wire string form. Extracted from Builder
# (TODO.impl/28) so the builder's property-assembly pipeline
# so the builder's property-assembly pipeline
# is a consumer of this module rather than owning the logic.
#
# Stateless — safe to call from any context. The Builder mixes
Expand Down
2 changes: 1 addition & 1 deletion lib/opencdd/codegen/ts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def generate_property_ids(path)
end

# Returns the generated TS source as a string (no filesystem
# access). Testable in-memory. See TODO.impl/31.
# access). Testable in-memory.
def render_property_ids
registry = Opencdd::PropertyIds::REGISTRY

Expand Down
2 changes: 1 addition & 1 deletion lib/opencdd/entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def replace_code_value!(code_property_id, new_code)
# synthetic-field semantics are consistent across all callers
# (SheetEmitter, Json exporter, validator, GUID setter, etc.).
# Callers that index +properties+ directly bypass these and
# risk round-trip drift — see TODO.impl/26.
# risk round-trip drift.

# Read a declared field by name. Accepts an optional +lang:+ for
# multilingual fields. Returns the typed value (parsed IRDI,
Expand Down
2 changes: 1 addition & 1 deletion lib/opencdd/languages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Opencdd
#
# The exporter scans each entity's +@properties+ hash for
# +<property_id>.<lang>+ keys to build per-field language maps
# (TODO.work/08). This class is the model object that aggregates
# This class is the model object that aggregates
# "what languages does this dictionary have?" — used by the browser
# to render a language switcher and by the data pipeline to report
# language coverage.
Expand Down
3 changes: 1 addition & 2 deletions lib/opencdd/parcel/referenced_irdis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ module Parcel
# Walks a sharded downloads directory and collects every IRDI
# referenced by a class .xls that points to a non-class entity
# (property, unit, value-list, value-term). The output manifest
# drives the per-entity scraper Pass 2 — see
# +TODO.cdd-editor/43-scraper-pass-2-per-entity.md+.
# drives the per-entity scraper Pass 2.
#
# Source columns on the CLASS .xls (parsed by +Opencdd::Klass+):
# applicable_property_irdis (MDC_P014) → property
Expand Down
2 changes: 1 addition & 1 deletion lib/opencdd/parcel/sheet_emitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def entity_value_for(entity, col)
# "where do I find the language-tagged variant of this field").
# Routed through Entity#read_field when the column maps to a
# declared field, so any future field-DTL changes apply here
# too — see TODO.impl/26.
# too.
def multilingual_lookup(entity, pid)
entry = Opencdd::PropertyIds::REGISTRY[pid]
return entity.properties["#{pid}.#{@source_language}"] if entry && entry.multilingual
Expand Down
11 changes: 5 additions & 6 deletions spec/code_quality_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

# Code-quality guard. Prevents regressions of the forbidden patterns
# documented in TODO.work/02:
# Code-quality guard. Prevents regressions of the forbidden patterns:
#
# - .send(:private_method) — bypasses encapsulation
# - instance_variable_set / instance_variable_get — same
Expand Down Expand Up @@ -40,7 +39,7 @@ def grep(pattern)
# - explicit method definition when the dispatch set is small
hits = grep(/[^_a-zA-Z]send\(/)
expect(hits).to be_empty,
".send found — use public_send or instance_exec (TODO.work/02):\n#{hits.join("\n")}"
".send found — use public_send or instance_exec :\n#{hits.join("\n")}"
end

it "does not use instance_variable_set / instance_variable_get" do
Expand All @@ -52,19 +51,19 @@ def grep(pattern)
it "does not use respond_to? for type checks" do
hits = grep(/\.respond_to\?\(/)
expect(hits).to be_empty,
"respond_to? found — use is_a? or design the hierarchy (TODO.work/02):\n#{hits.join("\n")}"
"respond_to? found — use is_a? or design the hierarchy :\n#{hits.join("\n")}"
end

it "does not use require_relative" do
hits = grep(/^\s*require_relative\s/)
expect(hits).to be_empty,
"require_relative found — use autoload in the parent namespace (TODO.work/01):\n#{hits.join("\n")}"
"require_relative found — use autoload in the parent namespace :\n#{hits.join("\n")}"
end

it "does not use require for internal opencdd paths" do
hits = grep(/^\s*require\s+["']opencdd\//).concat(grep(/^\s*require\s+["']cdd\//))
expect(hits).to be_empty,
"internal require found — use autoload in the parent namespace (TODO.work/01):\n#{hits.join("\n")}"
"internal require found — use autoload in the parent namespace :\n#{hits.join("\n")}"
end

it "autoloads every lib/opencdd/**/*.rb file from its parent namespace" do
Expand Down
3 changes: 1 addition & 2 deletions spec/import_pipeline_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

# End-to-end round-trip specs for the import pipeline (Phase 1).
#
# Covers the six scenarios called out in
# TODO.full-cdd/15-import-pipeline-and-change-requests.md:
# Covers the six scenarios:
#
# 1. aggregate — multiple parcel paths → single Database
# 2. split — Database → multiple per-partition parcels
Expand Down
2 changes: 1 addition & 1 deletion spec/parcel/round_trip_matrix_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def write_then_read(db, parcel_id:)
# names, with computed cross-entity fields like Property#value_list)
# is a projection of the in-memory model, not a serialization of
# the canonical @properties Hash. Building a JSON importer is
# deferred until TODO.final/19b Phase 2.5 collapses Exporters::Json
# deferred until the planned lutaml-model migration collapses Exporters::Json
# onto Entity::Yaml — at which point the wire shape becomes the
# lutaml-model attribute shape and round-trip is trivial.

Expand Down
4 changes: 2 additions & 2 deletions spec/parcel/round_trip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def build_database
# canonical IDs collide with ParcelMaker variant IDs (e.g.
# canonical MDC_P005 = short_name, but ParcelMaker uses
# MDC_P005 = definition). Round-trip through Parcel for those
# fields is tracked in TODO.impl/06-parcel-format.md.
# fields is a known Parcel-format limitation.
parent = Opencdd::Klass.new(
irdi: Opencdd::IRDI.parse("0112/2///61360_4#AAA000"),
properties: {
Expand All @@ -48,7 +48,7 @@ def build_database
end

# NOTE: These specs previously revealed a Writer → Reader round-trip
# drift (TODO.work/10). Root cause was the test fixture using
# drift. Root cause was the test fixture using
# MDC_C001 (Dictionary) as meta_class_irdi instead of MDC_C002
# (Class). Entities of unknown types get dropped by the Writer's
# per-type partition, so reread saw zero entities. Fixed by using
Expand Down
4 changes: 2 additions & 2 deletions spec/property_id_aliases_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require "spec_helper"

RSpec.describe Opencdd::PropertyIds, "alias registry integrity" do
# Regression guard for the alias-collision audit (TODO.complete/1).
# The audit (item A6 in data-private/TODO.full-cdd/17) flagged a
# Regression guard for the alias-collision audit.
# That audit flagged a
# hypothetical collision where two REGISTRY entries share an alias
# and `alias_map` silently keeps whichever was inserted last. As of
# this snapshot, no such collision exists in the REGISTRY. This
Expand Down
Loading