{"id":51166349,"url":"https://github.com/kiranandcode/agda-mode-telemetry","last_synced_at":"2026-06-26T19:02:28.364Z","repository":{"id":353188058,"uuid":"1218323366","full_name":"kiranandcode/agda-mode-telemetry","owner":"kiranandcode","description":"Agda2 mode with Telemetry","archived":false,"fork":false,"pushed_at":"2026-04-22T19:46:39.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-22T21:29:41.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiranandcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-22T18:59:43.000Z","updated_at":"2026-04-22T19:46:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kiranandcode/agda-mode-telemetry","commit_stats":null,"previous_names":["kiranandcode/agda-mode-telemetry"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kiranandcode/agda-mode-telemetry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranandcode%2Fagda-mode-telemetry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranandcode%2Fagda-mode-telemetry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranandcode%2Fagda-mode-telemetry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranandcode%2Fagda-mode-telemetry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiranandcode","download_url":"https://codeload.github.com/kiranandcode/agda-mode-telemetry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranandcode%2Fagda-mode-telemetry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34829415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-26T19:02:22.109Z","updated_at":"2026-06-26T19:02:28.351Z","avatar_url":"https://github.com/kiranandcode.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# agda-mode (with telemetry)\n\nFork of Emacs' agda-mode with telemetry.\n\nRequires Emacs 29+ (built-in SQLite support).\n\n## Design\n\nWhen `agda2-mode` activates on an `.agda` file, the telemetry module:\n\n1. Creates `.agda-telemetry.db` in the same directory as the file\n2. Logs a `session-start` event with an initial buffer snapshot\n3. Advises every command in `agda2-command-table` to record events\n4. Captures buffer snapshots and Agda responses after each interaction round\n5. Logs `session-end` with a final snapshot when the buffer is killed or Emacs exits\n\n## Database schema\n\nThe system is implemented with two tables, `events`, `snapshots` and `responses`\n\n### Schemas\n\n- `events`: list of user actions:\n\nOne row per user action.\n\n| Column            | Type       | Description                                                               |\n|-------------------|------------|---------------------------------------------------------------------------|\n| `id`              | INTEGER PK | Auto-incrementing event ID                                                |\n| `session_id`      | TEXT       | Unique session identifier (`YYYYMMDDHHMMSS_hash`)                         |\n| `timestamp`       | TEXT       | ISO 8601 with milliseconds (`2026-04-22T10:00:05.100+0000`)               |\n| `command`         | TEXT       | Elisp command name (`agda2-load`, `agda2-give`, etc.)                     |\n| `file`            | TEXT       | Filename (basename only, e.g. `Nat.agda`)                                 |\n| `point`           | INTEGER    | Buffer position (character offset)                                        |\n| `line`            | INTEGER    | Line number (1-indexed)                                                   |\n| `col`             | INTEGER    | Column number (0-indexed)                                                 |\n| `goal_number`     | INTEGER    | Goal number if cursor was in a goal, else NULL                            |\n| `goal_content`    | TEXT       | Text inside the goal braces, else NULL                                    |\n| `buffer_modified` | INTEGER    | 1 if buffer had unsaved changes, 0 otherwise                              |\n| `extra`           | TEXT       | Unified diff of buffer changes caused by this command (NULL if no change) |\n\nSynthetic events `session-start` and `session-end` mark session boundaries.\n\n- `snapshots`: buffer text after interaction rounds that modify the buffer.\n\n| Column     | Type       | Description                                      |\n|------------|------------|--------------------------------------------------|\n| `id`       | INTEGER PK | Auto-incrementing                                |\n| `event_id` | INTEGER    | References `events.id`                           |\n| `content`  | TEXT       | Complete buffer text after the command's effects |\n\nA snapshot is stored for `session-start` (initial state),\n`session-end` (final state), and after any command that changes the\nbuffer (load, give, refine, case split, etc.). Commands that don't\nmodify the buffer (navigation, show goals) have no snapshot.\n\n- `responses`: Agda process responses received during each interaction round (highlighting responses excluded).\n\n| Column          | Type       | Description                                                        |\n|-----------------|------------|--------------------------------------------------------------------|\n| `id`            | INTEGER PK | Auto-incrementing                                                  |\n| `event_id`      | INTEGER    | References `events.id`                                             |\n| `sequence`      | INTEGER    | Order within the round (0-indexed)                                 |\n| `function_name` | TEXT       | Response handler (`agda2-goals-action`, `agda2-give-action`, etc.) |\n| `args_text`     | TEXT       | S-expression of the response arguments                             |\n\n## Python tools\n\nAlongside the telemetry, as an example of what is possible with this data, we provide a couple of python scripts to visualise the data that has been recorded:\n\n- telemetry-extract.py: Quick analysis of recorded data.\n\n```\npython telemetry-extract.py /path/to/dir summary     # command frequency, per-file counts\npython telemetry-extract.py /path/to/dir sessions    # list all sessions\npython telemetry-extract.py /path/to/dir trace       # chronological trace with timing\npython telemetry-extract.py /path/to/dir dump        # raw events (--session, --command, --file, --limit)\n```\n\n- telemetry-replay.py: Reconstruct and replay proof development sessions.\n\n```\npython telemetry-replay.py /path/to/dir replay              # full trace with diffs\npython telemetry-replay.py /path/to/dir replay --step       # interactive step-through\npython telemetry-replay.py /path/to/dir replay --file X.agda  # filter to one file\npython telemetry-replay.py /path/to/dir diff 3              # diff for event 3\npython telemetry-replay.py /path/to/dir cat 5               # buffer state at event 5\npython telemetry-replay.py /path/to/dir export -o out/      # each state as a file\npython telemetry-replay.py /path/to/dir asciinema -o s.cast # asciicast v2 export\n```\n\nThe `asciinema` subcommand produces one `.cast` file per edited file. Play with `asciinema play s.cast` or upload with `asciinema upload s.cast`.\n\nAll subcommands accept `--session` and `--file` for filtering.\n\n## Build notes\n\nThe list of `.el` files is duplicated in `/src/agda-mode/Main.hs`, to instruct Emacs to compile these files.\nThe exception is `agda2-mode-pkg.el`, which is just meta-information about the mode and need not be compiled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiranandcode%2Fagda-mode-telemetry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiranandcode%2Fagda-mode-telemetry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiranandcode%2Fagda-mode-telemetry/lists"}