Skip to content

feat(ontology): add source-grounded occupational taxonomy - #719

Merged
seonghobae merged 11 commits into
feat/io-psych-construct-ontologyfrom
feat/io-occupational-taxonomy
Aug 27, 2026
Merged

feat(ontology): add source-grounded occupational taxonomy#719
seonghobae merged 11 commits into
feat/io-psych-construct-ontologyfrom
feat/io-occupational-taxonomy

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • publish source-grounded SOC major groups, current O*NET 31.0 Job Zones, RIASEC adjacency, ability domains, legacy work-value labels, and revised Work Styles families
  • add fail-closed deterministic read models and ontology/publication checks without asserting unsupported occupation-to-person characteristics
  • record the current exact-head PR queue and the still-unavailable job-series, detailed occupation, ISCO/ESCO, provenance, persistence, API, and UI gaps

Research corrections

  • use the official 2018 SOC titles for 25-0000 and 55-0000
  • use the four-row O*NET 31.0 Job Zone reference (source values 2-5)
  • distinguish revised O*NET Work Styles from the Hogan-Holland personality/job-performance evidence
  • prohibit person-level inference from occupational classification

Verification

  • uv run pytest tests -q (1367 passed, 12 skipped)
  • uv run pytest tests/test_worker_function_taxonomy.py tests/test_io_taxonomy.py tests/test_ontology.py tests/test_ontology_shapes.py tests/test_ontology_site.py tests/test_public_docstrings.py -q (104 passed after rebase)
  • git diff --check

Stacked on #709 exact observed head 8ef4090c; protected-main delivery remains unavailable until the stack and required independent review/checks complete.


Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 95072d41-5810-4aaf-83c6-4b44429c3084

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

# Conflicts:
#	CHANGELOG.md
#	docs/adr/README.md
#	docs/product-requirements.md
@seonghobae
seonghobae changed the base branch from feat/fja-worker-function-ontology to feat/io-psych-construct-ontology August 26, 2026 16:29
devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

Open in Devin Review

Comment on lines +377 to +382
if len(neighbors) != 2:
raise ValueError(
f"interest type {subject} declares {len(neighbors)} RIASEC "
f"neighbors; the published hexagon gives every type exactly "
f"two"
)

@devin-ai-integration devin-ai-integration Bot Aug 26, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: RIASEC neighbor count measures distinct labels

The two-neighbor guard in _interest_record_for counts distinct prefLabel strings in the neighbors set, not distinct adjacency edges. Two :riasecAdjacentTo targets sharing one label would collapse to a single neighbor. The current TTL uses distinct targets, so it never triggers.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

* feat(ontology): publish complete 2018 SOC hierarchy

* docs(gaps): record complete SOC hierarchy PR

* docs: assign unique SOC hierarchy ADR number

* docs: reserve unique SOC hierarchy ADR number

* fix: publish ontology artifact digest

* fix: publish parsed canonical ontology graph

* fix: label generated Turtle artifact accurately

* feat(ontology): publish complete O*NET 31.0 content model (#731)

* feat(ontology): publish O*NET 31 content model

* docs(gaps): refresh occupational PR gates

* fix(ontology): sort O*NET outline numerically

* fix(ontology): order O*NET outline numerically

* fix(adr): reserve O*NET content model decision number

* docs(adr): resolve O*NET publication boundary

---------

Co-authored-by: Codex <codex@localhost>

---------

Co-authored-by: Codex <codex@localhost>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 3 new potential issues.

Open in Devin Review

Comment on lines +505 to +509
canonical_rdf = _write_serializations(graph, ontology_dir)
# N-Triples is a strict subset of Turtle. Publishing the canonical graph
# avoids joining independent Turtle documents whose prefix/base scopes
# are document-local, while retaining a deterministic .ttl representation.
(ontology_dir / "ontology.ttl").write_text(canonical_rdf, encoding="utf-8")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Published ontology.ttl is now flat N-Triples

The served ontology.ttl is no longer the source file but the canonical N-Triples serialization of the merged graph (build_ontology_site.py). It parses as Turtle but loses all prefixes, comments, and structure. This matches the updated ADR 0159 and the 'generated equivalent' label.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread lineageweave/ontology.py
Comment on lines 64 to +67
graph = Graph()
graph.parse(_ONTOLOGY_PATH, format="turtle")
for fragment in _ONTOLOGY_FRAGMENT_PATHS:
graph.parse(fragment, format="turtle")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Large graph parsed at import and rendered fully

load_ontology() now parses ~1.3MB of generated fragments (4453 concepts) into the module-level ONTOLOGY at import. Publication additionally canonicalizes this graph and renders every concept as an HTML term card, so build time and page size grow substantially. Correctness is unaffected.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +349 to +356
if counts != {
"major_group": 23,
"minor_group": 98,
"broad_occupation": 459,
"detailed_occupation": 867,
}:
raise ValueError(f"2018 SOC hierarchy has unexpected level counts: {counts}")
return tuple(sorted(records, key=lambda record: record.code))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Read models hard-fail on any count drift

soc_classification_records and content_model_records assert exact counts ({23,98,459,867} and 3006) plus full parent closure on first call, raising ValueError on any drift. Intentional fail-closed design; any future source edit changing counts hard-fails all callers. Committed fragments currently match.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae
seonghobae merged commit 7292579 into feat/io-psych-construct-ontology Aug 27, 2026
4 checks passed
seonghobae added a commit that referenced this pull request Aug 27, 2026
…edes #719) (#751)

* feat(ontology): add source-grounded occupational taxonomy

* docs: refresh exact-head product gap evidence

* feat(ontology): preserve taxonomy source provenance

* feat(ontology): expose taxonomy source records

* fix(ontology): fail closed on duplicate SOC codes

* fix: expose taxonomy source rights

---------

Co-authored-by: Codex <codex@localhost>
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