Skip to content

Feature/going sdd#35

Merged
Zalfsten merged 16 commits into
mainfrom
feature/going-sdd
Apr 13, 2026
Merged

Feature/going sdd#35
Zalfsten merged 16 commits into
mainfrom
feature/going-sdd

Conversation

@Zalfsten
Copy link
Copy Markdown
Contributor

@Zalfsten Zalfsten commented Apr 9, 2026

No description provided.

Zalfsten and others added 9 commits April 9, 2026 11:36
…ARC building, database access, demo environment, and SQL-to-ARC conversion
…se access, demo environment, and SQL-to-ARC conversion
…and updating related functions for improved type safety and clarity
…ify annotation table streaming and connection string handling
…t_type fields to use Literal types for improved type safety
…and performance tuning; remove outdated architectural documentation
…ensions and obsolete architecture rules documentation
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a formal Pydantic model, AnnotationTableRow, to replace raw dictionary handling for annotation table data. It updates the database streaming, builder logic, and processor to use this typed model, improving type safety and validation. Additionally, it adds a warning for assays missing linked studies, refines the AnnotationTableRow validation, updates the demo environment documentation, and removes unused mapper code and redundant documentation.

…r structure, file requirements, and registration in AGENTS.md
- Introduced `ai_workflow.md` detailing the integration of AI coding agents, project structure, and VS Code integration.
- Documented the entry point for agents in `AGENTS.md`, emphasizing its role in providing project context.
- Explained the spec-driven development approach with a two-level layout for specs in `spec/` and `middleware/*/spec/`.
- Outlined the use of agent skills in `.agents/skills/`, including discovery, activation, and execution processes.
- Provided practical workflow examples for agents, including adding new config fields and fixing serialization bugs.
- Added new specs and design documents for API upload, ARC building, database access, and SQL-to-ARC conversion.
- Established principles for the FAIRagro SQL-to-ARC project, emphasizing correctness, memory safety, and security.
- Created demo environment specifications to facilitate local testing without external dependencies.
@Zalfsten
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request establishes a spec-driven development framework by introducing Specifica feature specifications, AI agent skills, and a formalized AI workflow. The core logic for processing annotation tables has been refactored to use a typed AnnotationTableRow Pydantic model, replacing raw dictionary handling and improving type safety across the builder, database, and processor modules. Additionally, the developer environment and project documentation have been cleaned up, including the removal of redundant architectural guides and unused VS Code extensions. Feedback highlights opportunities to refine error handling severity and optimize the placement of logging within data validation logic.

Comment thread middleware/sql_to_arc/src/middleware/sql_to_arc/builder.py
Comment thread middleware/sql_to_arc/src/middleware/sql_to_arc/models.py Outdated
@Zalfsten
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request establishes a robust, spec-driven architecture for the SQL-to-ARC converter by introducing Specifica-compliant feature documentation, custom AI agent configurations, and reusable 'Agent Skills' for library usage. Significant refactoring was performed in the sql_to_arc component to replace raw dictionary processing with a typed AnnotationTableRow model, enhancing type safety during database streaming and ARC construction. Review feedback identifies a mismatch between the column_io_type literal values and the supported arctrl IO types, highlights undefined variables in documentation code snippets, and points out several incorrect relative links in the newly added Markdown files.

table_name: str = spec_field()
column_type: str = spec_field()
row_index: int = spec_field()
column_io_type: Literal["data", "material_name", "sample_name", "source_name"] | None = spec_field(default=None)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The Literal type for column_io_type includes values ("data", "material_name") that do not seem to align with the known strings for IOType.of_string in the arctrl library, as documented in .agents/skills/arctrl/SKILL.md. The skill file lists "source_name", "sample_name", "raw_data_file", "derived_data_file", "image_file", and "material".

Using unsupported values like "data" (as seen in integration tests) could lead to runtime errors when arctrl attempts to process them. Please align the Literal values with those supported by arctrl to ensure correctness.

Suggested change
column_io_type: Literal["data", "material_name", "sample_name", "source_name"] | None = spec_field(default=None)
column_io_type: Literal["source_name", "sample_name", "raw_data_file", "derived_data_file", "image_file", "material"] | None = spec_field(default=None)

Comment on lines +211 to +214
if header.IsTermColumn:
cell = CompositeCell.term(OntologyAnnotation(str(value), "", ""))
else:
cell = CompositeCell.free_text(str(value))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The variable value used in this example code block is not defined, which could be confusing for a user or an AI agent trying to understand the example. Please define it to make the snippet self-contained and clearer.

Suggested change
if header.IsTermColumn:
cell = CompositeCell.term(OntologyAnnotation(str(value), "", ""))
else:
cell = CompositeCell.free_text(str(value))
value = "some_value"
if header.IsTermColumn:
cell = CompositeCell.term(OntologyAnnotation(str(value), "", ""))
else:
cell = CompositeCell.free_text(str(value))


```python
mocker.patch("mycomponent.main.ConfigWrapper.from_yaml_file")
mocker.patch("mycomponent.main.Config.from_config_wrapper", return_value=mock_config)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The variable mock_config used in this example is not defined. To make the example self-contained and easier to understand, please provide a definition for it.

Suggested change
mocker.patch("mycomponent.main.Config.from_config_wrapper", return_value=mock_config)
mock_config = Config(connection_string=SecretStr("..."), batch_size=10) # Example config
mocker.patch("mycomponent.main.Config.from_config_wrapper", return_value=mock_config)

## 7. Project Conventions

These rules apply specifically to this project (see also
[`spec/principles.md`](../../../spec/principles.md)):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The relative link to spec/principles.md appears to be incorrect. Given the file's location at .agents/skills/create-specifica-feature/SKILL.md, the path should navigate up four levels to the repository root.

Suggested change
[`spec/principles.md`](../../../spec/principles.md)):
[`spec/principles.md`](../../../../spec/principles.md)):


## Step 1 — Load project context

Read [`AGENTS.md`](../../AGENTS.md) to get the project's tech stack,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The relative link to AGENTS.md appears to be incorrect. From the current file's location, it should navigate up three levels to reach the repository root.

Suggested change
Read [`AGENTS.md`](../../AGENTS.md) to get the project's tech stack,
Read [`AGENTS.md`](../../../AGENTS.md) to get the project's tech stack,


The authoritative column-level specification for all views — including
required/optional fields, data types, and cross-dialect type mappings — is
maintained in [docs/sql_to_arc_database_views.md](../../../../docs/sql_to_arc_database_views.md).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The relative link to docs/sql_to_arc_database_views.md appears to be incorrect. Given this file's location, the path needs to navigate up five levels to reach the repository root.

Suggested change
maintained in [docs/sql_to_arc_database_views.md](../../../../docs/sql_to_arc_database_views.md).
maintained in [docs/sql_to_arc_database_views.md](../../../../../docs/sql_to_arc_database_views.md).

@Zalfsten
Copy link
Copy Markdown
Contributor Author

/gemini review

@Zalfsten Zalfsten marked this pull request as ready for review April 13, 2026 17:31
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive AI-agent-friendly documentation and workflow system based on the Specifica and Agent Skills standards. It reorganizes architectural documentation into structured feature folders containing requirement specs and design decisions, while providing on-demand procedural knowledge for libraries like arctrl. On the implementation side, the annotation table processing has been refactored to use a typed AnnotationTableRow Pydantic model instead of raw dictionaries, improving type safety and consistency across the pipeline. Additionally, support for Data cells in ARC tables was added, and tooling configurations for VS Code, Ruff, and Mypy were updated to align with the new project structure. I have no feedback to provide as all review comments were filtered out.

@Zalfsten Zalfsten merged commit 2038f45 into main Apr 13, 2026
9 checks passed
@Zalfsten Zalfsten deleted the feature/going-sdd branch April 13, 2026 17:39
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