Skip to content

Conversation

@iamh2o
Copy link
Contributor

@iamh2o iamh2o commented Jan 14, 2026

Add new Subject concept to separate facts (Objects) from decision scopes (Subjects).

Changes:

  • Database: Add sx_instance_seq sequence and polymorphic ORM classes (subject_template, subject_instance, subject_instance_lineage)
  • Config: Add subject templates for accession, analysis_bundle, report, and generic subject kinds
  • Helper Functions: Create bloom_lims/subjecting.py with create_subject, add_subject_members, list_subjects_for_object, etc.
  • Actions: Add create-subject-and-anchor action to core.json
  • UI: Display subject relationships in euid_details.html
  • Tests: Add test_subject_model.py with 12 passing tests
  • Docs: Add Subjects vs Objects section to README.md

Subjects are logical aggregates that decisions apply to, spanning multiple objects. They have stable, deterministic keys and support idempotent creation.

Add new Subject concept to separate facts (Objects) from decision scopes (Subjects).

Changes:
- Database: Add sx_instance_seq sequence and polymorphic ORM classes (subject_template, subject_instance, subject_instance_lineage)
- Config: Add subject templates for accession, analysis_bundle, report, and generic subject kinds
- Helper Functions: Create bloom_lims/subjecting.py with create_subject, add_subject_members, list_subjects_for_object, etc.
- Actions: Add create-subject-and-anchor action to core.json
- UI: Display subject relationships in euid_details.html
- Tests: Add test_subject_model.py with 12 passing tests
- Docs: Add Subjects vs Objects section to README.md

Subjects are logical aggregates that decisions apply to, spanning multiple objects.
They have stable, deterministic keys and support idempotent creation.
@iamh2o iamh2o merged commit 5a099c4 into main Jan 14, 2026
4 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fa10047cb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +181 to +185
bob.session.commit()

# Create anchor relationship
link_subject_anchor(bob, subject.euid, anchor_euid)

Choose a reason for hiding this comment

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

P2 Badge Abort subject creation when anchor link fails

In create_subject, the subject is committed before creating the anchor lineage and the return value of link_subject_anchor is ignored. If anchor_euid is invalid or the lineage insert fails (e.g., FK error), this function still returns a new subject EUID even though the subject has no anchor, leaving orphaned “decision scopes” that violate the model’s invariants and will surface in UI queries. Consider checking the link result and rolling back (or deleting) the subject when the anchor relationship cannot be created, or move the commit until after the link succeeds.

Useful? React with 👍 / 👎.

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.

2 participants