-
Notifications
You must be signed in to change notification settings - Fork 12
Feat/harvest aligned base v2 #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
71595e8
docs: add agent-browser roadmap and issue backlog
jerry609 a145ac1
feat: complete phase1 repo enrichment persistence flow
jerry609 8be5417
docs: scope agent-browser to advanced workflows only
jerry609 e5f19c0
docs: add agent runtime unification todo and issue cards
jerry609 3efceb7
docs: add agent inventory and boundary map
jerry609 432a088
feat: add unified agent runtime and source collector contracts
jerry609 7e3c7b9
feat: unify streaming envelope and trace propagation
jerry609 58aa6e5
refactor: migrate analyze and review routes to agent runtime
jerry609 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| """paper repos enrichment table | ||
|
|
||
| Revision ID: 0008_paper_repos | ||
| Revises: 0007_paper_harvest_tables | ||
| Create Date: 2026-02-11 | ||
|
|
||
| Adds paper_repos table to persist repository enrichment metadata linked to | ||
| canonical paper registry rows. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import context, op | ||
|
|
||
| revision = "0008_paper_repos" | ||
| down_revision = "0007_paper_harvest_tables" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def _is_offline() -> bool: | ||
| try: | ||
| return bool(context.is_offline_mode()) | ||
| except Exception: | ||
| return False | ||
|
|
||
|
|
||
| def _insp(): | ||
| return sa.inspect(op.get_bind()) | ||
|
|
||
|
|
||
| def _has_table(name: str) -> bool: | ||
| return _insp().has_table(name) | ||
|
|
||
|
|
||
| def _get_indexes(table: str) -> set[str]: | ||
| idx = set() | ||
| for i in _insp().get_indexes(table): | ||
| idx.add(str(i.get("name") or "")) | ||
| return idx | ||
|
|
||
|
|
||
| def _create_index(name: str, table: str, cols: list[str]) -> None: | ||
| if _is_offline(): | ||
| op.create_index(name, table, cols) | ||
| return | ||
| if name in _get_indexes(table): | ||
| return | ||
| op.create_index(name, table, cols) | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| if _is_offline() or not _has_table("paper_repos"): | ||
| op.create_table( | ||
| "paper_repos", | ||
| sa.Column("id", sa.Integer(), primary_key=True, autoincrement=True), | ||
| sa.Column("paper_id", sa.Integer(), sa.ForeignKey("papers.id"), nullable=False), | ||
| sa.Column("repo_url", sa.String(length=512), nullable=False, server_default=""), | ||
| sa.Column("full_name", sa.String(length=256), nullable=False, server_default=""), | ||
| sa.Column("description", sa.Text(), nullable=False, server_default=""), | ||
| sa.Column("stars", sa.Integer(), nullable=False, server_default="0"), | ||
| sa.Column("forks", sa.Integer(), nullable=False, server_default="0"), | ||
| sa.Column("open_issues", sa.Integer(), nullable=False, server_default="0"), | ||
| sa.Column("watchers", sa.Integer(), nullable=False, server_default="0"), | ||
| sa.Column("language", sa.String(length=64), nullable=False, server_default=""), | ||
| sa.Column("license", sa.String(length=64), nullable=False, server_default=""), | ||
| sa.Column("archived", sa.Boolean(), nullable=False, server_default=sa.false()), | ||
| sa.Column("html_url", sa.String(length=512), nullable=False, server_default=""), | ||
| sa.Column("topics_json", sa.Text(), nullable=False, server_default="[]"), | ||
| sa.Column("updated_at_remote", sa.DateTime(timezone=True), nullable=True), | ||
| sa.Column("pushed_at_remote", sa.DateTime(timezone=True), nullable=True), | ||
| sa.Column("query", sa.String(length=256), nullable=False, server_default=""), | ||
| sa.Column( | ||
| "source", | ||
| sa.String(length=32), | ||
| nullable=False, | ||
| server_default="paperscool_repo_enrich", | ||
| ), | ||
| sa.Column("metadata_json", sa.Text(), nullable=False, server_default="{}"), | ||
| sa.Column("synced_at", sa.DateTime(timezone=True), nullable=False), | ||
| sa.Column("created_at", sa.DateTime(timezone=True), nullable=False), | ||
| sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False), | ||
| sa.UniqueConstraint("paper_id", "repo_url", name="uq_paper_repos_paper_repo"), | ||
| ) | ||
|
|
||
| _create_index("ix_paper_repos_paper_id", "paper_repos", ["paper_id"]) | ||
| _create_index("ix_paper_repos_repo_url", "paper_repos", ["repo_url"]) | ||
| _create_index("ix_paper_repos_full_name", "paper_repos", ["full_name"]) | ||
| _create_index("ix_paper_repos_stars", "paper_repos", ["stars"]) | ||
| _create_index("ix_paper_repos_archived", "paper_repos", ["archived"]) | ||
| _create_index("ix_paper_repos_query", "paper_repos", ["query"]) | ||
| _create_index("ix_paper_repos_source", "paper_repos", ["source"]) | ||
| _create_index("ix_paper_repos_synced_at", "paper_repos", ["synced_at"]) | ||
| _create_index("ix_paper_repos_updated_at_remote", "paper_repos", ["updated_at_remote"]) | ||
| _create_index("ix_paper_repos_pushed_at_remote", "paper_repos", ["pushed_at_remote"]) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| op.drop_table("paper_repos") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate issue numbers: Issues 15 and 16 are defined twice.
The new entries at lines 270 and 286 reuse "Issue 15" and "Issue 16" which are already defined at lines 222 and 236. This will cause confusion when referencing issues. Renumber the new entries starting from Issue 17.
✏️ Suggested renumbering
🤖 Prompt for AI Agents