Skip to content

Comments

Improve documentation for priority algorithms and PersistedTask#506

Closed
matta wants to merge 1 commit intomainfrom
improve-docs-9186221861505617641
Closed

Improve documentation for priority algorithms and PersistedTask#506
matta wants to merge 1 commit intomainfrom
improve-docs-9186221861505617641

Conversation

@matta
Copy link
Owner

@matta matta commented Feb 21, 2026

Improved documentation for get_prioritized_tasks, get_score_trace, and PersistedTask to strictly adhere to Rust API Guidelines (RFC 1574).

  • Added comprehensive doc comments to get_prioritized_tasks explaining the hydration, prioritization, filtering, and sorting phases.
  • Added comprehensive doc comments to get_score_trace explaining its purpose for debugging and what the returned trace contains.
  • Added detailed field documentation to PersistedTask, clarifying it as the source of truth and explaining individual fields like id, status, credits, and schedule.

PR created automatically by Jules for task 9186221861505617641 started by @matta

Co-authored-by: matta <37314+matta@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 21, 2026

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @matta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the documentation for core task management algorithms and data structures, specifically get_prioritized_tasks, get_score_trace, and the PersistedTask struct. The enhancements aim to strictly adhere to Rust API Guidelines, providing clearer explanations of functionality, process stages, and field definitions for better code understanding and maintainability.

Highlights

  • get_prioritized_tasks documentation: Added comprehensive doc comments explaining the hydration, prioritization, filtering, and sorting phases of task processing.
  • get_score_trace documentation: Added comprehensive doc comments explaining its purpose for debugging and the detailed contents of the returned score trace.
  • PersistedTask documentation: Added detailed field documentation, clarifying its role as the authoritative source of truth and explaining individual fields like id, status, credits, and schedule.
Changelog
  • crates/tasklens-core/src/domain/priority.rs
    • Updated the doc comment for get_prioritized_tasks to detail its role as a projection engine and outline the four stages of task processing: hydration, prioritization, filtering, and sorting.
    • Enhanced the doc comment for get_score_trace to clarify its use for debugging and introspection, explaining that it reuses the core priority pipeline and detailing the breakdown of factors in the ScoreTrace.
  • crates/tasklens-core/src/types/persistent.rs
    • Revised the main doc comment for the PersistedTask struct to emphasize its role as the authoritative source of truth in the Automerge document and explain its use of autosurgeon attributes for hydration and reconciliation.
    • Added individual doc comments for numerous fields within PersistedTask, including status, id, title, notes, parent_id, child_task_ids, place_id, importance, credit_increment, credits, desired_credits, credits_timestamp, priority_timestamp, schedule, repeat_config, is_sequential, is_acknowledged, and last_completed_at.
Activity
  • PR created automatically by Jules for task 9186221861505617641, initiated by @matta.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 significantly improves the documentation for core data structures and priority algorithms, making the code easier to understand. The new doc comments are comprehensive and follow Rust API guidelines. The suggested correction for PersistedTask::priority_timestamp has been retained as it aligns with the rule regarding factual accuracy in documentation, preventing potential confusion. Overall, this is a valuable contribution to the project's maintainability.

proptest(strategy = "test_strategies::js_safe_u64()")
)]
pub credits_timestamp: i64,
/// Timestamp (ms) when priority was last recalculated (not persisted, transient).
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This comment is misleading. While the value of priority_timestamp is semantically transient (it becomes stale quickly), it is part of PersistedTask and is indeed persisted to the Automerge document. Stating it's "not persisted" is incorrect and could cause confusion for future developers. The comment should be updated to reflect that the value is persisted but should be treated as a transient cache.

Suggested change
/// Timestamp (ms) when priority was last recalculated (not persisted, transient).
/// Timestamp (ms) when priority was last recalculated (persisted, but semantically transient).
References
  1. Ensure that assertions about language features (e.g., method availability on types) are verified against authoritative documentation before being stated as facts, especially when presented with contradictory evidence. This principle extends to ensuring documentation accurately reflects code behavior to prevent confusion.

@matta
Copy link
Owner Author

matta commented Feb 24, 2026

Obsolete due to merge conflicts

@matta matta closed this Feb 24, 2026
@matta matta deleted the improve-docs-9186221861505617641 branch February 24, 2026 17:34
@google-labs-jules
Copy link
Contributor

Obsolete due to merge conflicts

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

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