Repository navigation
refactor(events): split services/events.py into a package - #371
Merged
Merged
Conversation
Move the module to services/events/__init__.py unchanged, so git records the rename and later commits extract one concern at a time. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the EventError hierarchy verbatim into a leaf module and declare the package's public surface in __all__, so every caller's import is unchanged. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es.py Move validate_coordinates and _optional_point verbatim. The package re-exports validate_coordinates, so services/events.validate_coordinates still names the bounds check. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ce_links.py Move the normalize, truncate, pair and row-building helpers verbatim. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the evidence floor checks, the proof sanitiser wrapper, the source swap, the tag and conflict resolvers and the geolocation credit verbatim. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nts/readiness.py Move DETECTION_READINESS, the proof-image jsonpath and detection_ready_predicate verbatim, with the comment blocks above them. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move create_with_evidence verbatim. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move ImportProvenance, stamp_provenance, create_request and update_request verbatim. The request-edit sweep test patches sweep_keys where update_request now looks it up, app.services.events.request. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation.py Move geolocate verbatim. The module is named geolocation so the package attribute geolocate stays the function rather than a submodule. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vision.py Move save_version verbatim. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move ROW_INTERNAL_ERROR_CODE, DetectionCompletion, _assert_owns_all, _publish_detection and complete_detections verbatim. The readiness test imports _publish_detection from its new module. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ckage Move close verbatim. __init__.py now holds only the package docstring, which maps the modules, and the re-exports. _publish_detection is re-exported under its own name because a route docstring that flows into the generated api-types cites services.events._publish_detection. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
engineering.md lists the package's modules in the repository layout. References to a symbol that no longer resolves at its old path point at its current module: AGENTS.md (the batch floor is services/events/batch._publish_detection), routers/tags.py, sanitize.py, lib/coordinates.ts and two planning/next.md links. Citations of re-exported names (services/events.validate_coordinates, services/events.geolocate, ...) still resolve and stay as they are. Signed-off-by: vidit-admin <admin@vidit.app> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vidit-admin <admin@vidit.app>
Drop the private re-export of _publish_detection from the package root and cite it as services/events/batch._publish_detection in the route docstring, the readiness test, and the frontend mirror. Regenerate api-types.ts from the updated docstring. Fix the shared-module count and the dependency direction in the package docstring, and name the module ImportProvenance lives in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vidit-admin <admin@vidit.app>
Indent the events/ children under their parent in docs/engineering.md, cite services/events/batch._publish_detection in docs/design.md and the planning/next.md batch-complete row, and link #371 in the changelog entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vidit-admin <admin@vidit.app>
vidit-admin
added a commit
that referenced
this pull request
Oct 3, 2026
The union merge strategy on planning/next.md reinserted the pre-split rows when main (#371) edited them. Restore the short next.md and apply #371's planning edits to backlog.md instead: the services/events package links and the dropped services map row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vidit-admin <admin@vidit.app>
vidit-admin
added a commit
that referenced
this pull request
Oct 4, 2026
* chore(planning): prune next.md of shipped, stale and duplicate rows Remove 38 rows from planning/next.md: 14 already shipped, 13 superseded or no longer accurate, and 11 older split rows that a merged row already covers. Move the Requests board triage row from P1 to P2. Fix docs/engineering.md: the client-IP helper it cited no longer exists; the rate limiter reaches the right-most XFF entry through rate_limit_key, and the auth-events audit log stores no IP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vidit-admin <admin@vidit.app> * chore(planning): split next.md into a short next.md and a full backlog.md next.md had grown to 145 rows and about 100 KB, too long to plan from. - planning/backlog.md holds all 145 rows with their original text, under the same version, Refactors and Unscheduled candidates sections, plus the cross-cutting rules. The empty v0.6.4 section is dropped. - planning/next.md keeps the v0.6 rows and the v0.7 P0 and P1 rows (14 rows), each reduced to a one-sentence outcome that links to its full row in backlog.md. - CONTRIBUTING.md states the row rule and extends the shipped and descoped steps to backlog.md; AGENTS.md lists backlog.md. - References that pointed at moved content (roadmap work breakdowns, README, issue and PR templates, CI comments, .gitattributes union merge, engineering.md tree, code comments) now point at backlog.md. - One stale link in a backlog row (OverflowMenu.tsx, removed in #293) is unlinked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vidit-admin <admin@vidit.app> * chore(planning): restore the short next.md after the main merge The union merge strategy on planning/next.md reinserted the pre-split rows when main (#371) edited them. Restore the short next.md and apply #371's planning edits to backlog.md instead: the services/events package links and the dropped services map row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vidit-admin <admin@vidit.app> * chore(planning): move the work tracker to the GitHub Project The work tracker now lives in the GitHub Project (vidithq/projects/1): issues in vidithq/vidit with a native type (Feature, Debt, Task, Bug) and the Status, Priority, Version and Area fields. planning/next.md and planning/backlog.md are deleted; git history keeps them. Pointers updated: - AGENTS.md: the tracker row names the Project, the backlog row is gone, doc rules 2 and 3 point tracker content and hedge prose at the Project. - CONTRIBUTING.md: new work is an issue with type, Priority, Version and Area; a shipping PR says Closes #N; the row-writing rules are gone. - README.md, planning/roadmap.md (work breakdown links filter the Backlog view by version), the PR and feature-request templates, docs/engineering.md repo tree, .gitattributes (CHANGELOG union merge only). - docs/backups.md, docs/engineering.md, docs/ingestion.md and code comments link the matching issue (#396, #429, #475, #476, #505, #515). docs-pairing: the job now requires a docs/ touch only (planning/ holds only roadmap.md). Exemptions are unchanged; the check is renamed "PR touches docs/" (not a required status check). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vidit-admin <admin@vidit.app> --------- Signed-off-by: vidit-admin <admin@vidit.app> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Splits
backend/app/services/events.py(1,700 lines) into aservices/events/package. Pure move: every top-level definition keeps its exact text. The package root re-exports the public API, sofrom app.services import eventscall sites stay unchanged.__init__.py__all__errors.pyEventErrorhierarchycoordinates.pyvalidate_coordinates,_optional_pointsource_links.pyrules.pyreadiness.pyDETECTION_READINESS,detection_ready_predicatecreate.py,request.py,geolocation.py,revision.py,batch.py,closure.pyImports run one way: a verb module imports shared modules, a shared module imports at most
errors, and no verb imports another.Notes
_publish_detectionstays private tobatch.py. Every citation (route docstring,lib/events.ts, its test,docs/design.md,planning/next.md, the readiness test) names it asservices/events/batch._publish_detection, andapi-types.tsis regenerated from the updated route docstring.app.services.events.batch(still under the configuredapplogger).test_requests.py, a private import intest_detections_readiness.py.AGENTS.md,docs/engineering.md,planning/next.md, and a few comments re-pointed at the new modules. The maintainer decided to drop theplanning/next.mdrow "Mapservices/before moving anything in it", because the package docstring anddocs/engineering.mdnow mapevents/.Supersedes #317.
Verifying the move
An AST comparison of every top-level definition against
origin/main:backend/app/services/events.pyfound them identical.git diff -M --color-moved=dimmed-zebra origin/main...HEADshows the moved blocks.Checks
Backend suite 1691 passed, 3 skipped. ruff, mypy, vulture,
make hygieneclean.make gen-api-typesleaves no diff.🤖 Generated with Claude Code